Class: Spree::Gallery::VariantGallery
- Inherits:
-
Object
- Object
- Spree::Gallery::VariantGallery
- Defined in:
- app/models/spree/gallery/variant_gallery.rb
Instance Method Summary collapse
-
#images ⇒ Enumerable<Spree::Image>
A list of all images associated with this gallery.
-
#initialize(variant) ⇒ VariantGallery
constructor
A new instance of VariantGallery.
Constructor Details
#initialize(variant) ⇒ VariantGallery
Returns a new instance of VariantGallery.
6 7 8 |
# File 'app/models/spree/gallery/variant_gallery.rb', line 6 def initialize(variant) @variant = variant end |
Instance Method Details
#images ⇒ Enumerable<Spree::Image>
A list of all images associated with this gallery
13 14 15 16 17 18 |
# File 'app/models/spree/gallery/variant_gallery.rb', line 13 def images @images ||= @variant.images.presence || (!@variant.is_master? && @variant.product.master.images).presence || Spree::Image.none end |