Class to parse and create Gist URLs
!@attribute id
@return [String] Gist ID
Instantiate {Gist} object from Gist URL @ return [Gist]
# File lib/octokit/gist.rb, line 12 def self.from_url(url) Gist.new(URI.parse(url).path[1..-1]) end
# File lib/octokit/gist.rb, line 16 def initialize(gist) case gist when Integer, String @id = gist.to_s end end
Gist ID @return [String]
# File lib/octokit/gist.rb, line 25 def to_s @id end
Gist URL @return [String]
# File lib/octokit/gist.rb, line 31 def url "https://gist.github.com/#{@id}" end