Class: FdxV660Api::HealthInsuranceMarketplaceCoveredIndividual

Inherits:
BaseModel
  • Object
show all
Defined in:
lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb

Overview

Used on Form 1095-A Part II

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from BaseModel

#check_for_conflict, #process_additional_properties, #process_array, #process_basic_value, #process_hash, #to_hash, #to_json

Constructor Details

#initialize(name: SKIP, tin: SKIP, date_of_birth: SKIP, policy_start_date: SKIP, policy_termination_date: SKIP, additional_properties: nil) ⇒ HealthInsuranceMarketplaceCoveredIndividual

Returns a new instance of HealthInsuranceMarketplaceCoveredIndividual.



59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 59

def initialize(name: SKIP, tin: SKIP, date_of_birth: SKIP,
               policy_start_date: SKIP, policy_termination_date: SKIP,
               additional_properties: nil)
  # Add additional model properties to the instance
  additional_properties = {} if additional_properties.nil?

  @name = name unless name == SKIP
  @tin = tin unless tin == SKIP
  @date_of_birth = date_of_birth unless date_of_birth == SKIP
  @policy_start_date = policy_start_date unless policy_start_date == SKIP
  @policy_termination_date = policy_termination_date unless policy_termination_date == SKIP
  @additional_properties = additional_properties
end

Instance Attribute Details

#date_of_birthDate

Covered individual date of birth

Returns:

  • (Date)


22
23
24
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 22

def date_of_birth
  @date_of_birth
end

#nameString

Covered individual name

Returns:

  • (String)


14
15
16
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 14

def name
  @name
end

#policy_start_dateDate

Coverage start date

Returns:

  • (Date)


26
27
28
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 26

def policy_start_date
  @policy_start_date
end

#policy_termination_dateDate

Coverage termination date

Returns:

  • (Date)


30
31
32
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 30

def policy_termination_date
  @policy_termination_date
end

#tinString

Covered individual SSN

Returns:

  • (String)


18
19
20
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 18

def tin
  @tin
end

Class Method Details

.from_hash(hash) ⇒ Object

Creates an instance of the object from a hash.



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
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 74

def self.from_hash(hash)
  return nil unless hash

  # Extract variables from the hash.
  name = hash.key?('name') ? hash['name'] : SKIP
  tin = hash.key?('tin') ? hash['tin'] : SKIP
  date_of_birth = hash.key?('dateOfBirth') ? hash['dateOfBirth'] : SKIP
  policy_start_date =
    hash.key?('policyStartDate') ? hash['policyStartDate'] : SKIP
  policy_termination_date =
    hash.key?('policyTerminationDate') ? hash['policyTerminationDate'] : SKIP

  # Create a new hash for additional properties, removing known properties.
  new_hash = hash.reject { |k, _| names.value?(k) }

  additional_properties = APIHelper.get_additional_properties(
    new_hash, proc { |value| value }
  )

  # Create object from extracted values.
  HealthInsuranceMarketplaceCoveredIndividual.new(name: name,
                                                  tin: tin,
                                                  date_of_birth: date_of_birth,
                                                  policy_start_date: policy_start_date,
                                                  policy_termination_date: policy_termination_date,
                                                  additional_properties: additional_properties)
end

.namesObject

A mapping from model property names to API property names.



33
34
35
36
37
38
39
40
41
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 33

def self.names
  @_hash = {} if @_hash.nil?
  @_hash['name'] = 'name'
  @_hash['tin'] = 'tin'
  @_hash['date_of_birth'] = 'dateOfBirth'
  @_hash['policy_start_date'] = 'policyStartDate'
  @_hash['policy_termination_date'] = 'policyTerminationDate'
  @_hash
end

.nullablesObject

An array for nullable fields



55
56
57
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 55

def self.nullables
  []
end

.optionalsObject

An array for optional fields



44
45
46
47
48
49
50
51
52
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 44

def self.optionals
  %w[
    name
    tin
    date_of_birth
    policy_start_date
    policy_termination_date
  ]
end

Instance Method Details

#inspectObject

Provides a debugging-friendly string with detailed object information.



111
112
113
114
115
116
117
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 111

def inspect
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name.inspect}, tin: #{@tin.inspect}, date_of_birth:"\
  " #{@date_of_birth.inspect}, policy_start_date: #{@policy_start_date.inspect},"\
  " policy_termination_date: #{@policy_termination_date.inspect}, additional_properties:"\
  " #{@additional_properties}>"
end

#to_sObject

Provides a human-readable string representation of the object.



103
104
105
106
107
108
# File 'lib/fdx_v660_api/models/health_insurance_marketplace_covered_individual.rb', line 103

def to_s
  class_name = self.class.name.split('::').last
  "<#{class_name} name: #{@name}, tin: #{@tin}, date_of_birth: #{@date_of_birth},"\
  " policy_start_date: #{@policy_start_date}, policy_termination_date:"\
  " #{@policy_termination_date}, additional_properties: #{@additional_properties}>"
end