Class: SixSaferpay::PayerProfile

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(has_account: nil, has_password: nil, password_forgotten: nil, first_name: nil, last_name: nil, company: nil, date_of_birth: nil, last_login_date: nil, gender: nil, creation_date: nil, password_last_change_date: nil, email: nil, secondary_email: nil, phone: nil) ⇒ PayerProfile

Returns a new instance of PayerProfile.



21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
# File 'lib/six_saferpay/models/payer_profile.rb', line 21

def initialize(
  has_account: nil,
  has_password: nil,
  password_forgotten: nil,
  first_name: nil,
  last_name: nil,
  company: nil,
  date_of_birth: nil,
  last_login_date: nil,
  gender: nil,
  creation_date: nil,
  password_last_change_date: nil,
  email: nil,
  secondary_email: nil,
  phone: nil
  )
  @has_account = 
  @has_password = has_password
  @password_forgotten = password_forgotten
  @first_name = first_name
  @last_name = last_name
  @company = company
  @date_of_birth = date_of_birth
  @last_login_date = 
  @gender = gender
  @creation_date = creation_date
  @password_last_change_date = password_last_change_date
  @email = email
  @secondary_email = secondary_email

  if phone
    @phone = SixSaferpay::Phone.new(**phone.to_h)
  end
end

Instance Attribute Details

#companyObject

Returns the value of attribute company.



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

def company
  @company
end

#creation_dateObject

Returns the value of attribute creation_date.



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

def creation_date
  @creation_date
end

#date_of_birthObject

Returns the value of attribute date_of_birth.



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

def date_of_birth
  @date_of_birth
end

#emailObject

Returns the value of attribute email.



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

def email
  @email
end

#first_nameObject

Returns the value of attribute first_name.



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

def first_name
  @first_name
end

#genderObject

Returns the value of attribute gender.



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

def gender
  @gender
end

#has_accountObject

Returns the value of attribute has_account.



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

def 
  @has_account
end

#has_passwordObject

Returns the value of attribute has_password.



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

def has_password
  @has_password
end

#last_login_dateObject

Returns the value of attribute last_login_date.



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

def 
  @last_login_date
end

#last_nameObject

Returns the value of attribute last_name.



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

def last_name
  @last_name
end

#password_forgottenObject

Returns the value of attribute password_forgotten.



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

def password_forgotten
  @password_forgotten
end

#password_last_change_dateObject

Returns the value of attribute password_last_change_date.



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

def password_last_change_date
  @password_last_change_date
end

#secondary_emailObject

Returns the value of attribute secondary_email.



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

def secondary_email
  @secondary_email
end

Instance Method Details

#to_hashObject Also known as: to_h



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
# File 'lib/six_saferpay/models/payer_profile.rb', line 56

def to_hash
  hash = Hash.new
  if !@has_account.nil?
    hash.merge!(has_account: @has_account)
  end
  if !@has_password.nil?
    hash.merge!(has_password: @has_password)
  end
  if !@password_forgotten.nil?
    hash.merge!(password_forgotten: @password_forgotten)
  end
  if @first_name
    hash.merge!(first_name: @first_name)
  end
  if @last_name
    hash.merge!(last_name: @last_name)
  end
  if @company
    hash.merge!(company: @company)
  end
  if @date_of_birth
    hash.merge!(date_of_birth: @date_of_birth)
  end
  if @last_login_date
    hash.merge!(last_login_date: @last_login_date)
  end
  if @gender
    hash.merge!(gender: @gender)
  end
  if @creation_date
    hash.merge!(creation_date: @creation_date)
  end
  if @password_last_change_date
    hash.merge!(password_last_change_date: @password_last_change_date)
  end
  if @email
    hash.merge!(email: @email)
  end
  if @secondary_email
    hash.merge!(secondary_email: @secondary_email)
  end
  if @phone
    hash.merge!(phone: @phone.to_h)
  end
  hash
end