Class: OnlinePayments::SDK::Domain::LineItemDetail
- Inherits:
-
DataObject
- Object
- DataObject
- OnlinePayments::SDK::Domain::LineItemDetail
- Defined in:
- lib/onlinepayments/sdk/domain/line_item_detail.rb
Instance Attribute Summary collapse
-
#discount_amount ⇒ Integer
The current value of discount_amount.
-
#line_item_id ⇒ String
The current value of line_item_id.
-
#quantity ⇒ Integer
The current value of quantity.
-
#tax_amount ⇒ Integer
The current value of tax_amount.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#discount_amount ⇒ Integer
Returns the current value of discount_amount.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 13 def discount_amount @discount_amount end |
#line_item_id ⇒ String
Returns the current value of line_item_id.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 13 def line_item_id @line_item_id end |
#quantity ⇒ Integer
Returns the current value of quantity.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 13 def quantity @quantity end |
#tax_amount ⇒ Integer
Returns the current value of tax_amount.
13 14 15 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 13 def tax_amount @tax_amount end |
Instance Method Details
#from_hash(hash) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 33 def from_hash(hash) super if hash.has_key? 'discountAmount' @discount_amount = hash['discountAmount'] end if hash.has_key? 'lineItemId' @line_item_id = hash['lineItemId'] end if hash.has_key? 'quantity' @quantity = hash['quantity'] end if hash.has_key? 'taxAmount' @tax_amount = hash['taxAmount'] end end |
#to_h ⇒ Hash
24 25 26 27 28 29 30 31 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 24 def to_h hash = super hash['discountAmount'] = @discount_amount unless @discount_amount.nil? hash['lineItemId'] = @line_item_id unless @line_item_id.nil? hash['quantity'] = @quantity unless @quantity.nil? hash['taxAmount'] = @tax_amount unless @tax_amount.nil? hash end |