Class: Tumbling::Photo::Image
- Inherits:
-
Object
- Object
- Tumbling::Photo::Image
- Defined in:
- lib/tumbling/photo.rb
Instance Attribute Summary collapse
-
#alt ⇒ Object
Returns the value of attribute alt.
-
#url ⇒ Object
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(url, alt = nil) ⇒ Image
constructor
A new instance of Image.
- #to_html ⇒ Object
Constructor Details
#initialize(url, alt = nil) ⇒ Image
Returns a new instance of Image.
43 44 45 46 |
# File 'lib/tumbling/photo.rb', line 43 def initialize(url, alt = nil) @url = url @alt = alt end |
Instance Attribute Details
#alt ⇒ Object
Returns the value of attribute alt.
42 43 44 |
# File 'lib/tumbling/photo.rb', line 42 def alt @alt end |
#url ⇒ Object
Returns the value of attribute url.
42 43 44 |
# File 'lib/tumbling/photo.rb', line 42 def url @url end |
Instance Method Details
#to_html ⇒ Object
47 48 49 |
# File 'lib/tumbling/photo.rb', line 47 def to_html "<img src=\"#{url}\" alt=\"#{alt}\" />" end |