Class: SpreeCmCommissioner::Feed::TaxonIncludeProduct

Inherits:
Object
  • Object
show all
Includes:
ActiveModel::Serialization
Defined in:
app/services/spree_cm_commissioner/feed/taxon_include_product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(taxon:, products:) ⇒ TaxonIncludeProduct

Returns a new instance of TaxonIncludeProduct.



8
9
10
11
12
13
14
15
16
17
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 8

def initialize(taxon:, products:)
  @id = taxon.id
  @name = taxon.name
  @description = taxon.description
  @permalink = taxon.permalink
  @pretty_name = taxon.pretty_name

  @products = products
  @product_ids = products.map(&:id)
end

Instance Attribute Details

#descriptionObject

Returns the value of attribute description.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def description
  @description
end

#idObject

Returns the value of attribute id.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def id
  @id
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def name
  @name
end

Returns the value of attribute permalink.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def permalink
  @permalink
end

#pretty_nameObject

Returns the value of attribute pretty_name.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def pretty_name
  @pretty_name
end

#product_idsObject

Returns the value of attribute product_ids.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def product_ids
  @product_ids
end

#productsObject

Returns the value of attribute products.



6
7
8
# File 'app/services/spree_cm_commissioner/feed/taxon_include_product.rb', line 6

def products
  @products
end