Class: Ingenico::Connect::SDK::Domain::Product::AccountOnFile

Inherits:
Ingenico::Connect::SDK::DataObject show all
Defined in:
lib/ingenico/connect/sdk/domain/product/account_on_file.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Connect::SDK::DataObject

new_from_hash

Instance Attribute Details

#attributesArray<Ingenico::Connect::SDK::Domain::Product::AccountOnFileAttribute>

Returns the current value of attributes.

Returns:



17
18
19
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 17

def attributes
  @attributes
end

#display_hintsIngenico::Connect::SDK::Domain::Product::AccountOnFileDisplayHints

Returns the current value of display_hints.

Returns:



17
18
19
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 17

def display_hints
  @display_hints
end

#idInteger

Returns the current value of id.

Returns:

  • (Integer)

    the current value of id



17
18
19
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 17

def id
  @id
end

#payment_product_idInteger

Returns the current value of payment_product_id.

Returns:

  • (Integer)

    the current value of payment_product_id



17
18
19
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 17

def payment_product_id
  @payment_product_id
end

Instance Method Details

#from_hash(hash) ⇒ Object



37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 37

def from_hash(hash)
  super
  if hash.has_key? 'attributes'
    raise TypeError, "value '%s' is not an Array" % [hash['attributes']] unless hash['attributes'].is_a? Array
    @attributes = []
    hash['attributes'].each do |e|
      @attributes << Ingenico::Connect::SDK::Domain::Product::AccountOnFileAttribute.new_from_hash(e)
    end
  end
  if hash.has_key? 'displayHints'
    raise TypeError, "value '%s' is not a Hash" % [hash['displayHints']] unless hash['displayHints'].is_a? Hash
    @display_hints = Ingenico::Connect::SDK::Domain::Product::AccountOnFileDisplayHints.new_from_hash(hash['displayHints'])
  end
  if hash.has_key? 'id'
    @id = hash['id']
  end
  if hash.has_key? 'paymentProductId'
    @payment_product_id = hash['paymentProductId']
  end
end

#to_hHash

Returns:

  • (Hash)


28
29
30
31
32
33
34
35
# File 'lib/ingenico/connect/sdk/domain/product/account_on_file.rb', line 28

def to_h
  hash = super
  hash['attributes'] = @attributes.collect{|val| val.to_h} unless @attributes.nil?
  hash['displayHints'] = @display_hints.to_h unless @display_hints.nil?
  hash['id'] = @id unless @id.nil?
  hash['paymentProductId'] = @payment_product_id unless @payment_product_id.nil?
  hash
end