Class: Workarea::Search::Storefront::ProductOptionImageUrl
- Inherits:
-
ProductPrimaryImageUrl
- Object
- ProductPrimaryImageUrl
- Workarea::Search::Storefront::ProductOptionImageUrl
- Defined in:
- app/models/workarea/search/storefront/product_option_image_url.rb
Instance Method Summary collapse
- #image ⇒ Object
-
#initialize(product, image_size: :small_thumb, option:) ⇒ ProductOptionImageUrl
constructor
A new instance of ProductOptionImageUrl.
Constructor Details
#initialize(product, image_size: :small_thumb, option:) ⇒ ProductOptionImageUrl
Returns a new instance of ProductOptionImageUrl.
5 6 7 8 |
# File 'app/models/workarea/search/storefront/product_option_image_url.rb', line 5 def initialize(product, image_size: :small_thumb, option:) super(product, image_size) @option = option end |
Instance Method Details
#image ⇒ Object
10 11 12 13 14 |
# File 'app/models/workarea/search/storefront/product_option_image_url.rb', line 10 def image @product.images.find_by(option: @option) rescue Mongoid::Errors::DocumentNotFound super end |