Class: OnlinePayments::SDK::Domain::BatchMetadata

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from DataObject

new_from_hash

Instance Attribute Details

#item_countInteger

Returns the current value of item_count.

Returns:

  • (Integer)

    the current value of item_count



12
13
14
# File 'lib/onlinepayments/sdk/domain/batch_metadata.rb', line 12

def item_count
  @item_count
end

#merchant_batch_referenceString

Returns the current value of merchant_batch_reference.

Returns:

  • (String)

    the current value of merchant_batch_reference



12
13
14
# File 'lib/onlinepayments/sdk/domain/batch_metadata.rb', line 12

def merchant_batch_reference
  @merchant_batch_reference
end

#operation_typeString

Returns the current value of operation_type.

Returns:

  • (String)

    the current value of operation_type



12
13
14
# File 'lib/onlinepayments/sdk/domain/batch_metadata.rb', line 12

def operation_type
  @operation_type
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/batch_metadata.rb', line 29

def from_hash(hash)
  super
  if hash.has_key? 'itemCount'
    @item_count = hash['itemCount']
  end
  if hash.has_key? 'merchantBatchReference'
    @merchant_batch_reference = hash['merchantBatchReference']
  end
  if hash.has_key? 'operationType'
    @operation_type = hash['operationType']
  end
end

#to_hHash

Returns:

  • (Hash)


21
22
23
24
25
26
27
# File 'lib/onlinepayments/sdk/domain/batch_metadata.rb', line 21

def to_h
  hash = super
  hash['itemCount'] = @item_count unless @item_count.nil?
  hash['merchantBatchReference'] = @merchant_batch_reference unless @merchant_batch_reference.nil?
  hash['operationType'] = @operation_type unless @operation_type.nil?
  hash
end