Class: Fotolia::Medium::Thumbnail

Inherits:
Object
  • Object
show all
Defined in:
lib/fotolia/medium.rb

Overview

A thumbnail attached to a Medium object. Just holds its url, width, height and an html tag to include it on web pages.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes) ⇒ Thumbnail

Returns a new instance of Thumbnail.



13
14
15
16
17
18
# File 'lib/fotolia/medium.rb', line 13

def initialize(attributes)
  @url = attributes['thumbnail_url']
  @html_tag = attributes['thumbnail_html_tag']
  @width = attributes['thumbnail_width']
  @height = attributes['thumbnail_height']
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



11
12
13
# File 'lib/fotolia/medium.rb', line 11

def height
  @height
end

#html_tagObject (readonly)

Returns the value of attribute html_tag.



11
12
13
# File 'lib/fotolia/medium.rb', line 11

def html_tag
  @html_tag
end

#urlObject (readonly)

Returns the value of attribute url.



11
12
13
# File 'lib/fotolia/medium.rb', line 11

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



11
12
13
# File 'lib/fotolia/medium.rb', line 11

def width
  @width
end