class Octokit::Gist

Class to parse and create Gist URLs

def self.from_url(url)

@ return [Gist]
Instantiate {Gist} object from Gist URL
def self.from_url(url)
  Gist.new(URI.parse(url).path[1..])
end

def initialize(gist)

def initialize(gist)
  case gist
  when Integer, String
    @id = gist.to_s
  end
end

def to_s

Returns:
  • (String) -
def to_s
  @id
end

def url

Returns:
  • (String) -
def url
  "https://gist.github.com/#{@id}"
end