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.
Instance Method Summary collapse
Methods inherited from DataObject
Instance Attribute Details
#discount_amount ⇒ Integer
Returns the current value of discount_amount.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 12 def discount_amount @discount_amount end |
#line_item_id ⇒ String
Returns the current value of line_item_id.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 12 def line_item_id @line_item_id end |
#quantity ⇒ Integer
Returns the current value of quantity.
12 13 14 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 12 def quantity @quantity end |
Instance Method Details
#from_hash(hash) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 29 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 end |
#to_h ⇒ Hash
21 22 23 24 25 26 27 |
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 21 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 end |