Class: Unit::Types::ApplicationFormPrefill
- Inherits:
-
Object
- Object
- Unit::Types::ApplicationFormPrefill
- Defined in:
- lib/unit-ruby/types/application_form_prefill.rb
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#application_type ⇒ Object
readonly
Returns the value of attribute application_type.
-
#date_of_birth ⇒ Object
readonly
Returns the value of attribute date_of_birth.
-
#email ⇒ Object
readonly
Returns the value of attribute email.
-
#full_name ⇒ Object
readonly
Returns the value of attribute full_name.
-
#nationality ⇒ Object
readonly
Returns the value of attribute nationality.
-
#passport ⇒ Object
readonly
Returns the value of attribute passport.
-
#phone ⇒ Object
readonly
Returns the value of attribute phone.
-
#ssn ⇒ Object
readonly
Returns the value of attribute ssn.
Class Method Summary collapse
Instance Method Summary collapse
- #as_json_api ⇒ Object
-
#initialize(application_type: nil, full_name: nil, ssn: nil, passport: nil, nationality: nil, date_of_birth: nil, email: nil, address: nil, phone: nil) ⇒ ApplicationFormPrefill
constructor
A new instance of ApplicationFormPrefill.
Constructor Details
#initialize(application_type: nil, full_name: nil, ssn: nil, passport: nil, nationality: nil, date_of_birth: nil, email: nil, address: nil, phone: nil) ⇒ ApplicationFormPrefill
Returns a new instance of ApplicationFormPrefill.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 7 def initialize( application_type: nil, full_name: nil, ssn: nil, passport: nil, nationality: nil, date_of_birth: nil, email: nil, address: nil, phone: nil ) @application_type = application_type @full_name = full_name @ssn = ssn @passport = passport @nationality = nationality @date_of_birth = date_of_birth @email = email @address = address @phone = phone end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def address @address end |
#application_type ⇒ Object (readonly)
Returns the value of attribute application_type.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def application_type @application_type end |
#date_of_birth ⇒ Object (readonly)
Returns the value of attribute date_of_birth.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def date_of_birth @date_of_birth end |
#email ⇒ Object (readonly)
Returns the value of attribute email.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def email @email end |
#full_name ⇒ Object (readonly)
Returns the value of attribute full_name.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def full_name @full_name end |
#nationality ⇒ Object (readonly)
Returns the value of attribute nationality.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def nationality @nationality end |
#passport ⇒ Object (readonly)
Returns the value of attribute passport.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def passport @passport end |
#phone ⇒ Object (readonly)
Returns the value of attribute phone.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def phone @phone end |
#ssn ⇒ Object (readonly)
Returns the value of attribute ssn.
4 5 6 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 4 def ssn @ssn end |
Class Method Details
.cast(val) ⇒ Object
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 29 def self.cast(val) return val if val.is_a? self return nil if val.nil? new( application_type: val[:application_type], full_name: val[:full_name], ssn: val[:ssn], passport: val[:passport], nationality: val[:nationality], date_of_birth: val[:date_of_birth], email: val[:email], address: val[:address], phone: val[:phone] ) end |
Instance Method Details
#as_json_api ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 57 58 |
# File 'lib/unit-ruby/types/application_form_prefill.rb', line 46 def as_json_api { application_type: application_type, full_name: full_name&.as_json_api, ssn: ssn, passport: passport, nationality: nationality, date_of_birth: date_of_birth, email: email, address: address&.as_json_api, phone: phone&.as_json_api }.compact end |