Class: Gusto::SupportedBenefit
- Inherits:
-
Object
- Object
- Gusto::SupportedBenefit
- Defined in:
- lib/fern_gusto/types/supported_benefit.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#benefit_type ⇒ Float
readonly
The benefit type in Gusto.
-
#category ⇒ String
readonly
Category where the benefit belongs to.
-
#description ⇒ String
readonly
The description of the benefit.
-
#healthcare ⇒ Boolean
readonly
Whether the benefit is healthcare related.
-
#imputed ⇒ Boolean
readonly
Whether the benefit is considered imputed income.
-
#name ⇒ String
readonly
The name of the benefit.
-
#posttax ⇒ Boolean
readonly
Whether the benefit is deducted after tax calculations.
-
#pretax ⇒ Object
readonly
taxable income.
-
#retirement ⇒ Boolean
readonly
Whether the benefit is associated with retirement planning.
-
#yearly_limit ⇒ Boolean
readonly
Whether the benefit has a government mandated yearly limit.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(benefit_type: OMIT, name: OMIT, description: OMIT, pretax: OMIT, posttax: OMIT, imputed: OMIT, healthcare: OMIT, retirement: OMIT, yearly_limit: OMIT, category: OMIT, additional_properties: nil) ⇒ Gusto::SupportedBenefit constructor
- #to_json ⇒ String
Constructor Details
#initialize(benefit_type: OMIT, name: OMIT, description: OMIT, pretax: OMIT, posttax: OMIT, imputed: OMIT, healthcare: OMIT, retirement: OMIT, yearly_limit: OMIT, category: OMIT, additional_properties: nil) ⇒ Gusto::SupportedBenefit
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 50 def initialize(benefit_type: OMIT, name: OMIT, description: OMIT, pretax: OMIT, posttax: OMIT, imputed: OMIT, healthcare: OMIT, retirement: OMIT, yearly_limit: OMIT, category: OMIT, additional_properties: nil) @benefit_type = benefit_type if benefit_type != OMIT @name = name if name != OMIT @description = description if description != OMIT @pretax = pretax if pretax != OMIT @posttax = posttax if posttax != OMIT @imputed = imputed if imputed != OMIT @healthcare = healthcare if healthcare != OMIT @retirement = retirement if retirement != OMIT @yearly_limit = yearly_limit if yearly_limit != OMIT @category = category if category != OMIT @additional_properties = additional_properties @_field_set = { "benefit_type": benefit_type, "name": name, "description": description, "pretax": pretax, "posttax": posttax, "imputed": imputed, "healthcare": healthcare, "retirement": retirement, "yearly_limit": yearly_limit, "category": category }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
30 31 32 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 30 def additional_properties @additional_properties end |
#benefit_type ⇒ Float (readonly)
Returns The benefit type in Gusto.
9 10 11 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 9 def benefit_type @benefit_type end |
#category ⇒ String (readonly)
Returns Category where the benefit belongs to.
28 29 30 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 28 def category @category end |
#description ⇒ String (readonly)
Returns The description of the benefit.
13 14 15 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 13 def description @description end |
#healthcare ⇒ Boolean (readonly)
Returns Whether the benefit is healthcare related.
22 23 24 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 22 def healthcare @healthcare end |
#imputed ⇒ Boolean (readonly)
Returns Whether the benefit is considered imputed income.
20 21 22 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 20 def imputed @imputed end |
#name ⇒ String (readonly)
Returns The name of the benefit.
11 12 13 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 11 def name @name end |
#posttax ⇒ Boolean (readonly)
Returns Whether the benefit is deducted after tax calculations.
18 19 20 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 18 def posttax @posttax end |
#pretax ⇒ Object (readonly)
taxable income
16 17 18 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 16 def pretax @pretax end |
#retirement ⇒ Boolean (readonly)
Returns Whether the benefit is associated with retirement planning.
24 25 26 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 24 def retirement @retirement end |
#yearly_limit ⇒ Boolean (readonly)
Returns Whether the benefit has a government mandated yearly limit.
26 27 28 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 26 def yearly_limit @yearly_limit end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::SupportedBenefit
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 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 70 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) benefit_type = parsed_json["benefit_type"] name = parsed_json["name"] description = parsed_json["description"] pretax = parsed_json["pretax"] posttax = parsed_json["posttax"] imputed = parsed_json["imputed"] healthcare = parsed_json["healthcare"] retirement = parsed_json["retirement"] yearly_limit = parsed_json["yearly_limit"] category = parsed_json["category"] new( benefit_type: benefit_type, name: name, description: description, pretax: pretax, posttax: posttax, imputed: imputed, healthcare: healthcare, retirement: retirement, yearly_limit: yearly_limit, category: category, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 109 def self.validate_raw(obj:) obj.benefit_type&.is_a?(Float) != false || raise("Passed value for field obj.benefit_type is not the expected type, validation failed.") obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.description&.is_a?(String) != false || raise("Passed value for field obj.description is not the expected type, validation failed.") obj.pretax&.is_a?(Boolean) != false || raise("Passed value for field obj.pretax is not the expected type, validation failed.") obj.posttax&.is_a?(Boolean) != false || raise("Passed value for field obj.posttax is not the expected type, validation failed.") obj.imputed&.is_a?(Boolean) != false || raise("Passed value for field obj.imputed is not the expected type, validation failed.") obj.healthcare&.is_a?(Boolean) != false || raise("Passed value for field obj.healthcare is not the expected type, validation failed.") obj.retirement&.is_a?(Boolean) != false || raise("Passed value for field obj.retirement is not the expected type, validation failed.") obj.yearly_limit&.is_a?(Boolean) != false || raise("Passed value for field obj.yearly_limit is not the expected type, validation failed.") obj.category&.is_a?(String) != false || raise("Passed value for field obj.category is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
100 101 102 |
# File 'lib/fern_gusto/types/supported_benefit.rb', line 100 def to_json @_field_set&.to_json end |