Class: SpreeKlaviyo::TaxonPresenter
- Inherits:
-
Object
- Object
- SpreeKlaviyo::TaxonPresenter
- Includes:
- Spree::BaseHelper, Spree::ImagesHelper
- Defined in:
- app/presenters/spree_klaviyo/taxon_presenter.rb
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(taxon:) ⇒ TaxonPresenter
constructor
A new instance of TaxonPresenter.
Constructor Details
#initialize(taxon:) ⇒ TaxonPresenter
Returns a new instance of TaxonPresenter.
7 8 9 |
# File 'app/presenters/spree_klaviyo/taxon_presenter.rb', line 7 def initialize(taxon:) @taxon = taxon end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 |
# File 'app/presenters/spree_klaviyo/taxon_presenter.rb', line 11 def call { name: @taxon.pretty_name, image_url: @taxon.image.present? ? spree_image_url(@taxon.image, width: 1200, height: 1200, format: :png) : '', url: spree_storefront_resource_url(@taxon, store: @taxon.store) } end |