class Epages::ImageSize
Attributes
images[RW]
name[RW]
Public Class Methods
new(data)
click to toggle source
# File lib/epages/image_size.rb, line 9 def initialize(data) parse_attribute_as_array_of(:images, data.delete(:sizes), Epages::Image) parse_attributes(data) end
Public Instance Methods
length()
click to toggle source
return the length of the slideshow
# File lib/epages/image_size.rb, line 28 def length images.size end
size_link(size)
click to toggle source
return the link of image with the indicated size
@param size [String]. The name of the image classifier
# 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()
click to toggle source
return a sorted array with the name of all available sizes
# File lib/epages/image_size.rb, line 15 def sizes images.collect(&:classifier).sort end