Class: Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem
- Inherits:
-
Object
- Object
- Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem
- Defined in:
- lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb
Overview
A single tier of a tiered matching scheme.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#rate ⇒ Object
readonly
will match.
-
#threshold ⇒ Object
readonly
match employee deductions from 0% up to and including 5% of payroll.
-
#threshold_delta ⇒ Object
readonly
threshold.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(rate: OMIT, threshold: OMIT, threshold_delta: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(rate: OMIT, threshold: OMIT, threshold_delta: OMIT, additional_properties: nil) ⇒ Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem
39 40 41 42 43 44 45 46 47 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 39 def initialize(rate: OMIT, threshold: OMIT, threshold_delta: OMIT, additional_properties: nil) @rate = rate if rate != OMIT @threshold = threshold if threshold != OMIT @threshold_delta = threshold_delta if threshold_delta != OMIT @additional_properties = additional_properties @_field_set = { "rate": rate, "threshold": threshold, "threshold_delta": threshold_delta }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
21 22 23 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 21 def additional_properties @additional_properties end |
#rate ⇒ Object (readonly)
will match.
10 11 12 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 10 def rate @rate end |
#threshold ⇒ Object (readonly)
match employee deductions from 0% up to and including 5% of payroll.
16 17 18 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 16 def threshold @threshold end |
#threshold_delta ⇒ Object (readonly)
threshold. In the first tier, this is equivalent to threshold.
19 20 21 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 19 def threshold_delta @threshold_delta end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::EmployeeBenefitBaseObjectContributionValueTiersTiersItem
53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 53 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) rate = parsed_json["rate"] threshold = parsed_json["threshold"] threshold_delta = parsed_json["threshold_delta"] new( rate: rate, threshold: threshold, threshold_delta: threshold_delta, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
79 80 81 82 83 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 79 def self.validate_raw(obj:) obj.rate&.is_a?(String) != false || raise("Passed value for field obj.rate is not the expected type, validation failed.") obj.threshold&.is_a?(String) != false || raise("Passed value for field obj.threshold is not the expected type, validation failed.") obj.threshold_delta&.is_a?(String) != false || raise("Passed value for field obj.threshold_delta is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
70 71 72 |
# File 'lib/fern_gusto/types/employee_benefit_base_object_contribution_value_tiers_tiers_item.rb', line 70 def to_json @_field_set&.to_json end |