Class: Gusto::AccruingTimeOffHour
- Inherits:
-
Object
- Object
- Gusto::AccruingTimeOffHour
- Defined in:
- lib/fern_gusto/types/accruing_time_off_hour.rb
Overview
The representation of an unprocessed termination pay period.
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#hours ⇒ String
readonly
Hours accrued during this pay period.
-
#time_off_policy_uuid ⇒ String
readonly
A unique identifier of the time off policy.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(time_off_policy_uuid: OMIT, hours: OMIT, additional_properties: nil) ⇒ Gusto::AccruingTimeOffHour constructor
- #to_json ⇒ String
Constructor Details
#initialize(time_off_policy_uuid: OMIT, hours: OMIT, additional_properties: nil) ⇒ Gusto::AccruingTimeOffHour
24 25 26 27 28 29 30 31 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 24 def initialize(time_off_policy_uuid: OMIT, hours: OMIT, additional_properties: nil) @time_off_policy_uuid = time_off_policy_uuid if time_off_policy_uuid != OMIT @hours = hours if hours != OMIT @additional_properties = additional_properties @_field_set = { "time_off_policy_uuid": time_off_policy_uuid, "hours": hours }.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/types/accruing_time_off_hour.rb', line 13 def additional_properties @additional_properties end |
#hours ⇒ String (readonly)
Returns Hours accrued during this pay period.
11 12 13 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 11 def hours @hours end |
#time_off_policy_uuid ⇒ String (readonly)
Returns A unique identifier of the time off policy.
9 10 11 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 9 def time_off_policy_uuid @time_off_policy_uuid end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::AccruingTimeOffHour
36 37 38 39 40 41 42 43 44 45 46 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 36 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) time_off_policy_uuid = parsed_json["time_off_policy_uuid"] hours = parsed_json["hours"] new( time_off_policy_uuid: time_off_policy_uuid, hours: hours, additional_properties: struct ) end |
.validate_raw(obj:) ⇒ Void
59 60 61 62 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 59 def self.validate_raw(obj:) obj.time_off_policy_uuid&.is_a?(String) != false || raise("Passed value for field obj.time_off_policy_uuid is not the expected type, validation failed.") obj.hours&.is_a?(String) != false || raise("Passed value for field obj.hours is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
50 51 52 |
# File 'lib/fern_gusto/types/accruing_time_off_hour.rb', line 50 def to_json @_field_set&.to_json end |