Class: FlickrOfflineGallery::PhotoSize

Inherits:
Object
  • Object
show all
Defined in:
lib/flickr_offline_gallery/photo_size.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(flickraw_response) ⇒ PhotoSize

Returns a new instance of PhotoSize.



6
7
8
9
10
11
# File 'lib/flickr_offline_gallery/photo_size.rb', line 6

def initialize(flickraw_response)
  @label  = flickraw_response.label
  @height = flickraw_response.height
  @width  = flickraw_response.width
  @url = flickraw_response.source
end

Instance Attribute Details

#heightObject (readonly)

Returns the value of attribute height.



4
5
6
# File 'lib/flickr_offline_gallery/photo_size.rb', line 4

def height
  @height
end

#labelObject (readonly)

Returns the value of attribute label.



4
5
6
# File 'lib/flickr_offline_gallery/photo_size.rb', line 4

def label
  @label
end

#urlObject (readonly)

Returns the value of attribute url.



4
5
6
# File 'lib/flickr_offline_gallery/photo_size.rb', line 4

def url
  @url
end

#widthObject (readonly)

Returns the value of attribute width.



4
5
6
# File 'lib/flickr_offline_gallery/photo_size.rb', line 4

def width
  @width
end

Instance Method Details

#keyObject



13
14
15
# File 'lib/flickr_offline_gallery/photo_size.rb', line 13

def key
  label.downcase.gsub(" ", "_")
end