Class: Ingenico::Direct::SDK::Domain::CardEssentials

Inherits:
Ingenico::Direct::SDK::DataObject show all
Defined in:
lib/ingenico/direct/sdk/domain/card_essentials.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Ingenico::Direct::SDK::DataObject

new_from_hash

Instance Attribute Details

#card_numberString

Returns the current value of card_number.

Returns:

  • (String)

    the current value of card_number



12
13
14
# File 'lib/ingenico/direct/sdk/domain/card_essentials.rb', line 12

def card_number
  @card_number
end

#expiry_dateString

Returns the current value of expiry_date.

Returns:

  • (String)

    the current value of expiry_date



12
13
14
# File 'lib/ingenico/direct/sdk/domain/card_essentials.rb', line 12

def expiry_date
  @expiry_date
end

Instance Method Details

#from_hash(hash) ⇒ Object



24
25
26
27
28
# File 'lib/ingenico/direct/sdk/domain/card_essentials.rb', line 24

def from_hash(hash)
  super
  @card_number = hash['cardNumber'] if hash.key? 'cardNumber'
  @expiry_date = hash['expiryDate'] if hash.key? 'expiryDate'
end

#to_hHash

Returns:

  • (Hash)


17
18
19
20
21
22
# File 'lib/ingenico/direct/sdk/domain/card_essentials.rb', line 17

def to_h
  hash = super
  hash['cardNumber'] = @card_number unless @card_number.nil?
  hash['expiryDate'] = @expiry_date unless @expiry_date.nil?
  hash
end