Class: Prestashop::Mapper::ProductSupplier

Inherits:
Model
  • Object
show all
Defined in:
lib/prestashop/mapper/models/product_supplier.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Model

#hash_lang, #meta_description, #meta_keywords, #meta_title, model, resource

Methods included from Extension

included

Constructor Details

#initialize(args = {}) ⇒ ProductSupplier

Returns a new instance of ProductSupplier.


10
11
12
13
14
15
16
17
18
19
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 10

def initialize args = {}
  @id_supplier = settings[:id_supplier]

  @id_product           = args.fetch(:id_product)
  @id_product_attribute = args.fetch(:id_product_attribute, 0)
  @id_currency          = args.fetch(:id_currency, 0)

  @product_supplier_reference = args[:product_supplier_reference]
  @product_supplier_price_te  = args[:product_supplier_price_te]
end

Instance Attribute Details

#id_currencyObject (readonly)

Returns the value of attribute id_currency


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def id_currency
  @id_currency
end

#id_productObject (readonly)

Returns the value of attribute id_product


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def id_product
  @id_product
end

#id_product_attributeObject (readonly)

Returns the value of attribute id_product_attribute


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def id_product_attribute
  @id_product_attribute
end

#id_supplierObject (readonly)

Returns the value of attribute id_supplier


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def id_supplier
  @id_supplier
end

#product_supplier_price_teObject (readonly)

Returns the value of attribute product_supplier_price_te


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def product_supplier_price_te
  @product_supplier_price_te
end

#product_supplier_referenceObject (readonly)

Returns the value of attribute product_supplier_reference


8
9
10
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 8

def product_supplier_reference
  @product_supplier_reference
end

Instance Method Details

#hashObject


21
22
23
24
25
26
27
28
# File 'lib/prestashop/mapper/models/product_supplier.rb', line 21

def hash
  { id_product:                 id_product,
    id_product_attribute:       id_product_attribute,
    id_supplier:                id_supplier,
    product_supplier_reference: product_supplier_reference,
    product_supplier_price_te:  product_supplier_price_te,
    id_currency:                id_currency }
end