Class: Tumbling::Photo::Image

Inherits:
Object
  • Object
show all
Defined in:
lib/tumbling/photo.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(url, alt = nil) ⇒ Image

Returns a new instance of Image.



42
43
44
45
# File 'lib/tumbling/photo.rb', line 42

def initialize(url, alt = nil)
  @url = url
  @alt = alt
end

Instance Attribute Details

#altObject

Returns the value of attribute alt.



41
42
43
# File 'lib/tumbling/photo.rb', line 41

def alt
  @alt
end

#urlObject

Returns the value of attribute url.



41
42
43
# File 'lib/tumbling/photo.rb', line 41

def url
  @url
end

Instance Method Details

#to_htmlObject



46
47
48
# File 'lib/tumbling/photo.rb', line 46

def to_html
  "<img src=\"#{url}\" alt=\"#{alt}\" />"
end