Class: Spree::Gallery::VariantGallery

Inherits:
Object
  • Object
show all
Defined in:
core/app/models/spree/gallery/variant_gallery.rb

Instance Method Summary collapse

Constructor Details

#initialize(variant) ⇒ VariantGallery

Returns a new instance of VariantGallery



6
7
8
# File 'core/app/models/spree/gallery/variant_gallery.rb', line 6

def initialize(variant)
  @variant = variant
end

Instance Method Details

#imagesEnumerable<Spree::Image>

A list of all images associated with this gallery

Returns:



13
14
15
16
17
18
# File 'core/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