Class: ImageGallery::GalleryGenerator::GalleryModel
- Inherits:
-
Struct
- Object
- Struct
- ImageGallery::GalleryGenerator::GalleryModel
- Defined in:
- lib/gallery/gallery.rb
Instance Attribute Summary collapse
-
#datetime ⇒ Object
Returns the value of attribute datetime.
-
#highlight_image ⇒ Object
Returns the value of attribute highlight_image.
-
#id ⇒ Object
Returns the value of attribute id.
-
#images ⇒ Object
Returns the value of attribute images.
-
#name ⇒ Object
Returns the value of attribute name.
Instance Method Summary collapse
Instance Attribute Details
#datetime ⇒ Object
Returns the value of attribute datetime
20 21 22 |
# File 'lib/gallery/gallery.rb', line 20 def datetime @datetime end |
#highlight_image ⇒ Object
Returns the value of attribute highlight_image
20 21 22 |
# File 'lib/gallery/gallery.rb', line 20 def highlight_image @highlight_image end |
#id ⇒ Object
Returns the value of attribute id
20 21 22 |
# File 'lib/gallery/gallery.rb', line 20 def id @id end |
#images ⇒ Object
Returns the value of attribute images
20 21 22 |
# File 'lib/gallery/gallery.rb', line 20 def images @images end |
#name ⇒ Object
Returns the value of attribute name
20 21 22 |
# File 'lib/gallery/gallery.rb', line 20 def name @name end |
Instance Method Details
#to_liquid ⇒ Object
21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/gallery/gallery.rb', line 21 def to_liquid to_h.map do |k, v| if k == :datetime [k.to_s, { 'year' => v.year, 'month' => v.month, 'day' => v.day }] elsif v.class.method_defined?(:to_liquid) [k.to_s, v.to_liquid] else [k.to_s, v] end end.to_h end |