Class: Epages::ImageSize
- Inherits:
-
Object
- Object
- Epages::ImageSize
- Includes:
- Utils
- Defined in:
- lib/epages/image_size.rb
Instance Attribute Summary collapse
-
#images ⇒ Object
Returns the value of attribute images.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data) ⇒ ImageSize
constructor
A new instance of ImageSize.
-
#length ⇒ Object
return the length of the slideshow.
-
#size_link(size) ⇒ Object
return the link of image with the indicated size.
-
#sizes ⇒ Object
return a sorted array with the name of all available sizes.
Methods included from Utils
build_shop_from, camelize_keys, camelize_words, options_to_multipart_request, options_to_patch_request, parse_attribute_as, parse_attribute_as_array_of, parse_attributes, symbolize_keys!, to_query_options, underscorize_keys
Constructor Details
Instance Attribute Details
#images ⇒ Object
Returns the value of attribute images.
7 8 9 |
# File 'lib/epages/image_size.rb', line 7 def images @images end |
#name ⇒ Object
Returns the value of attribute name.
7 8 9 |
# File 'lib/epages/image_size.rb', line 7 def name @name end |
Instance Method Details
#length ⇒ Object
return the length of the slideshow
28 29 30 |
# File 'lib/epages/image_size.rb', line 28 def length images.size end |
#size_link(size) ⇒ Object
return the link of image with the indicated size
22 23 24 25 |
# File 'lib/epages/image_size.rb', line 22 def size_link(size) link = images.find { |i| i.classifier == size } link ? link.url : nil end |
#sizes ⇒ Object
return a sorted array with the name of all available sizes
15 16 17 |
# File 'lib/epages/image_size.rb', line 15 def sizes images.collect(&:classifier).sort end |