Class: Gusto::Companies::CompanyCompensationsHourlyItem
- Inherits:
-
Object
- Object
- Gusto::Companies::CompanyCompensationsHourlyItem
- Defined in:
- lib/fern_gusto/companies/types/company_compensations_hourly_item.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#multiple ⇒ Float
readonly
The amount multiplied by the base rate of a job to calculate compensation.
-
#name ⇒ String
readonly
The name of the hourly compensation rate.
Class Method Summary collapse
- .from_json(json_object:) ⇒ Gusto::Companies::CompanyCompensationsHourlyItem
- .validate_raw(obj:) ⇒ Void
Instance Method Summary collapse
- #initialize(name: OMIT, multiple: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyCompensationsHourlyItem constructor
- #to_json ⇒ String
Constructor Details
#initialize(name: OMIT, multiple: OMIT, additional_properties: nil) ⇒ Gusto::Companies::CompanyCompensationsHourlyItem
24 25 26 27 28 29 30 31 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 24 def initialize(name: OMIT, multiple: OMIT, additional_properties: nil) @name = name if name != OMIT @multiple = multiple if multiple != OMIT @additional_properties = additional_properties @_field_set = { "name": name, "multiple": multiple }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
13 14 15 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 13 def additional_properties @additional_properties end |
#multiple ⇒ Float (readonly)
Returns The amount multiplied by the base rate of a job to calculate compensation.
11 12 13 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 11 def multiple @multiple end |
#name ⇒ String (readonly)
Returns The name of the hourly compensation rate.
9 10 11 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 9 def name @name end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::Companies::CompanyCompensationsHourlyItem
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) name = parsed_json["name"] multiple = parsed_json["multiple"] new( name: name, multiple: multiple, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
59 60 61 62 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 59 def self.validate_raw(obj:) obj.name&.is_a?(String) != false || raise("Passed value for field obj.name is not the expected type, validation failed.") obj.multiple&.is_a?(Float) != false || raise("Passed value for field obj.multiple is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
50 51 52 |
# File 'lib/fern_gusto/companies/types/company_compensations_hourly_item.rb', line 50 def to_json @_field_set&.to_json end |