Class: CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue
- Inherits:
-
Object
- Object
- CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue
- Defined in:
- lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
- #family ⇒ Float readonly
- #individual ⇒ Float readonly
Class Method Summary collapse
-
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue
Deserialize a JSON object to an instance of CoverageValue.
-
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given hash and check each fields type against the current object’s property definitions.
Instance Method Summary collapse
- #initialize(family: OMIT, individual: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue constructor
-
#to_json(*_args) ⇒ String
Serialize an instance of CoverageValue to a JSON object.
Constructor Details
#initialize(family: OMIT, individual: OMIT, additional_properties: nil) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue
28 29 30 31 32 33 34 35 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 28 def initialize(family: OMIT, individual: OMIT, additional_properties: nil) @family = family if family != OMIT @individual = individual if individual != OMIT @additional_properties = additional_properties @_field_set = { "family": family, "individual": individual }.reject do |_k, v| v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
17 18 19 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 17 def additional_properties @additional_properties end |
#family ⇒ Float (readonly)
13 14 15 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 13 def family @family end |
#individual ⇒ Float (readonly)
15 16 17 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 15 def individual @individual end |
Class Method Details
.from_json(json_object:) ⇒ CandidApiClient::PreEncounter::Coverages::V1::Types::CoverageValue
Deserialize a JSON object to an instance of CoverageValue
41 42 43 44 45 46 47 48 49 50 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 41 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) family = struct["family"] individual = struct["individual"] new( family: family, individual: individual, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
Leveraged for Union-type generation, validate_raw attempts to parse the given
hash and check each fields type against the current object's property
definitions.
65 66 67 68 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 65 def self.validate_raw(obj:) obj.family&.is_a?(Float) != false || raise("Passed value for field obj.family is not the expected type, validation failed.") obj.individual&.is_a?(Float) != false || raise("Passed value for field obj.individual is not the expected type, validation failed.") end |
Instance Method Details
#to_json(*_args) ⇒ String
Serialize an instance of CoverageValue to a JSON object
55 56 57 |
# File 'lib/candidhealth/pre_encounter/coverages/v_1/types/coverage_value.rb', line 55 def to_json(*_args) @_field_set&.to_json end |