Class: SixSaferpay::ResponseCard

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(masked_number:, exp_year:, exp_month:, holder_name: nil, holder_segment: nil, country_code: nil, hash_value: nil) ⇒ ResponseCard

Returns a new instance of ResponseCard.



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/six_saferpay/models/response_card.rb', line 13

def initialize(masked_number:,
              exp_year:,
              exp_month:,
              holder_name: nil,
              holder_segment: nil,
              country_code: nil,
              hash_value: nil
              )
  @masked_number = masked_number
  @exp_year = exp_year
  @exp_month = exp_month
  @holder_name = holder_name
  @holder_segment = holder_segment
  @country_code = country_code
  @hash_value = hash_value
end

Instance Attribute Details

#country_codeObject

Returns the value of attribute country_code.



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

def country_code
  @country_code
end

#exp_monthObject

Returns the value of attribute exp_month.



4
5
6
# File 'lib/six_saferpay/models/response_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/response_card.rb', line 4

def exp_year
  @exp_year
end

#hash_valueObject

Returns the value of attribute hash_value.



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

def hash_value
  @hash_value
end

#holder_nameObject

Returns the value of attribute holder_name.



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

def holder_name
  @holder_name
end

#holder_segmentObject

Returns the value of attribute holder_segment.



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

def holder_segment
  @holder_segment
end

#masked_numberObject

Returns the value of attribute masked_number.



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

def masked_number
  @masked_number
end

Instance Method Details

#to_hashObject Also known as: to_h



30
31
32
33
34
35
36
37
38
39
40
# File 'lib/six_saferpay/models/response_card.rb', line 30

def to_hash
  hash = Hash.new
  hash.merge!(masked_number: @masked_number)
  hash.merge!(exp_year: @exp_year)
  hash.merge!(exp_month: @exp_month)
  hash.merge!(holder_name: @holder_name) if @holder_name
  hash.merge!(holder_segment: @holder_segment) if @holder_segment
  hash.merge!(country_code: @country_code) if @country_code
  hash.merge!(hash_value: @hash_value) if @hash_value
  hash
end