Class: EmbeddedURL::Gist
- Inherits:
-
Object
- Object
- EmbeddedURL::Gist
- Defined in:
- lib/embedded_url/gist.rb
Instance Attribute Summary collapse
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url) ⇒ Gist
constructor
A new instance of Gist.
- #to_embedded ⇒ Object
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
#url ⇒ Object
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_embedded ⇒ Object
10 11 12 13 14 |
# File 'lib/embedded_url/gist.rb', line 10 def if url =~ /gist\.github\.com/ '<script src="' + url + '.js"></script>' end end |