Class: SixSaferpay::RequestCard

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(number:, exp_year:, exp_month:, holder_name: nil, verification_code: nil) ⇒ RequestCard

Returns a new instance of RequestCard.



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/six_saferpay/models/request_card.rb', line 11

def initialize(number:,
              exp_year:,
              exp_month:,
              holder_name: nil,
              verification_code: nil
              )
  @number = number
  @exp_year = exp_year
  @exp_month = exp_month
  @holder_name = holder_name
  @verification_code = verification_code
end

Instance Attribute Details

#exp_monthObject

Returns the value of attribute exp_month.



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

def exp_month
  @exp_month
end

#exp_yearObject

Returns the value of attribute exp_year.



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

def exp_year
  @exp_year
end

#holder_nameObject

Returns the value of attribute holder_name.



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

def holder_name
  @holder_name
end

#numberObject

Returns the value of attribute number.



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

def number
  @number
end

#verification_codeObject

Returns the value of attribute verification_code.



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

def verification_code
  @verification_code
end

Instance Method Details

#to_hashObject Also known as: to_h



24
25
26
27
28
29
30
31
32
# File 'lib/six_saferpay/models/request_card.rb', line 24

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