Class: Akatus::Product

Inherits:
Object
  • Object
show all
Defined in:
lib/akatus/product.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ Product

Returns a new instance of Product.



5
6
7
8
9
# File 'lib/akatus/product.rb', line 5

def initialize(attributes = {})
  attributes.each do |name, value|  
    send("#{name}=", value)  
  end  
end

Instance Attribute Details

#codeObject

Returns the value of attribute code.



3
4
5
# File 'lib/akatus/product.rb', line 3

def code
  @code
end

#discount_amountObject

Returns the value of attribute discount_amount.



3
4
5
# File 'lib/akatus/product.rb', line 3

def discount_amount
  @discount_amount
end

#freight_amountObject

Returns the value of attribute freight_amount.



3
4
5
# File 'lib/akatus/product.rb', line 3

def freight_amount
  @freight_amount
end

#nameObject

Returns the value of attribute name.



3
4
5
# File 'lib/akatus/product.rb', line 3

def name
  @name
end

#priceObject

Returns the value of attribute price.



3
4
5
# File 'lib/akatus/product.rb', line 3

def price
  @price
end

#quantityObject

Returns the value of attribute quantity.



3
4
5
# File 'lib/akatus/product.rb', line 3

def quantity
  @quantity
end

#weightObject

Returns the value of attribute weight.



3
4
5
# File 'lib/akatus/product.rb', line 3

def weight
  @weight
end