Class: OnlinePayments::SDK::Domain::OrderLineDetails
- Inherits:
-
OnlinePayments::SDK::DataObject
- Object
- OnlinePayments::SDK::DataObject
- OnlinePayments::SDK::Domain::OrderLineDetails
- Defined in:
- lib/onlinepayments/sdk/domain/order_line_details.rb
Instance Attribute Summary collapse
-
#discount_amount ⇒ Long
The current value of discount_amount.
-
#product_code ⇒ String
The current value of product_code.
-
#product_name ⇒ String
The current value of product_name.
-
#product_price ⇒ Long
The current value of product_price.
-
#product_type ⇒ String
The current value of product_type.
-
#quantity ⇒ Long
The current value of quantity.
-
#tax_amount ⇒ Long
The current value of tax_amount.
-
#unit ⇒ String
The current value of unit.
Instance Method Summary collapse
Methods inherited from OnlinePayments::SDK::DataObject
Instance Attribute Details
#discount_amount ⇒ Long
Returns the current value of discount_amount.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def discount_amount @discount_amount end |
#product_code ⇒ String
Returns the current value of product_code.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def product_code @product_code end |
#product_name ⇒ String
Returns the current value of product_name.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def product_name @product_name end |
#product_price ⇒ Long
Returns the current value of product_price.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def product_price @product_price end |
#product_type ⇒ String
Returns the current value of product_type.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def product_type @product_type end |
#quantity ⇒ Long
Returns the current value of quantity.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def quantity @quantity end |
#tax_amount ⇒ Long
Returns the current value of tax_amount.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def tax_amount @tax_amount end |
#unit ⇒ String
Returns the current value of unit.
17 18 19 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 17 def unit @unit end |
Instance Method Details
#from_hash(hash) ⇒ Object
41 42 43 44 45 46 47 48 49 50 51 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 41 def from_hash(hash) super @discount_amount = hash['discountAmount'] if hash.key? 'discountAmount' @product_code = hash['productCode'] if hash.key? 'productCode' @product_name = hash['productName'] if hash.key? 'productName' @product_price = hash['productPrice'] if hash.key? 'productPrice' @product_type = hash['productType'] if hash.key? 'productType' @quantity = hash['quantity'] if hash.key? 'quantity' @tax_amount = hash['taxAmount'] if hash.key? 'taxAmount' @unit = hash['unit'] if hash.key? 'unit' end |
#to_h ⇒ Hash
28 29 30 31 32 33 34 35 36 37 38 39 |
# File 'lib/onlinepayments/sdk/domain/order_line_details.rb', line 28 def to_h hash = super hash['discountAmount'] = @discount_amount unless @discount_amount.nil? hash['productCode'] = @product_code unless @product_code.nil? hash['productName'] = @product_name unless @product_name.nil? hash['productPrice'] = @product_price unless @product_price.nil? hash['productType'] = @product_type unless @product_type.nil? hash['quantity'] = @quantity unless @quantity.nil? hash['taxAmount'] = @tax_amount unless @tax_amount.nil? hash['unit'] = @unit unless @unit.nil? hash end |