Class: EmbeddedURL::Gist

Inherits:
Object
  • Object
show all
Defined in:
lib/embedded_url/gist.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url) ⇒ Gist

Returns a new instance of Gist.



6
7
8
# File 'lib/embedded_url/gist.rb', line 6

def initialize(url)
  self.url = url
end

Instance Attribute Details

#urlObject

Returns the value of attribute url.



4
5
6
# File 'lib/embedded_url/gist.rb', line 4

def url
  @url
end

Instance Method Details

#to_embeddedObject



10
11
12
13
14
# File 'lib/embedded_url/gist.rb', line 10

def to_embedded
  if url =~ /gist\.github\.com/
    '<script src="' + url + '.js"></script>'
  end
end