Class: SixSaferpay::CardForm

Inherits:
Object
  • Object
show all
Defined in:
lib/six_saferpay/models/card_form.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(holder_name: nil, verification_code: nil) ⇒ CardForm

Returns a new instance of CardForm.



9
10
11
12
13
14
15
16
# File 'lib/six_saferpay/models/card_form.rb', line 9

def initialize(
  holder_name: nil,
  verification_code: nil
)
  @holder_name = holder_name
  @verification_code = verification_code

end

Instance Attribute Details

#holder_nameObject

Returns the value of attribute holder_name.



4
5
6
# File 'lib/six_saferpay/models/card_form.rb', line 4

def holder_name
  @holder_name
end

#verification_codeObject

Returns the value of attribute verification_code.



4
5
6
# File 'lib/six_saferpay/models/card_form.rb', line 4

def verification_code
  @verification_code
end

Instance Method Details

#to_hashObject Also known as: to_h



18
19
20
21
22
23
# File 'lib/six_saferpay/models/card_form.rb', line 18

def to_hash
  hash = Hash.new
  hash.merge!(holder_name: @holder_name) if @holder_name
  hash.merge!(verification_code: @verification_code) if @verification_code
  hash
end