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.



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

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

Instance Attribute Details

#altObject

Returns the value of attribute alt.



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

def alt
  @alt
end

#urlObject

Returns the value of attribute url.



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

def url
  @url
end

Instance Method Details

#to_htmlObject



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

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