Class: OnlinePayments::SDK::Domain::LineItemDetail

Inherits:
DataObject
  • Object
show all
Defined in:
lib/onlinepayments/sdk/domain/line_item_detail.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#line_item_idString

Returns the current value of line_item_id.

Returns:

  • (String)

    the current value of line_item_id



11
12
13
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 11

def line_item_id
  @line_item_id
end

#quantityInteger

Returns the current value of quantity.

Returns:

  • (Integer)

    the current value of quantity



11
12
13
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 11

def quantity
  @quantity
end

Instance Method Details

#from_hash(hash) ⇒ Object



25
26
27
28
29
30
31
32
33
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 25

def from_hash(hash)
  super
  if hash.has_key? 'lineItemId'
    @line_item_id = hash['lineItemId']
  end
  if hash.has_key? 'quantity'
    @quantity = hash['quantity']
  end
end

#to_hHash

Returns:

  • (Hash)


18
19
20
21
22
23
# File 'lib/onlinepayments/sdk/domain/line_item_detail.rb', line 18

def to_h
  hash = super
  hash['lineItemId'] = @line_item_id unless @line_item_id.nil?
  hash['quantity'] = @quantity unless @quantity.nil?
  hash
end