Class: Gusto::HistoricalEmployeeBodyTermination
- Inherits:
-
Object
- Object
- Gusto::HistoricalEmployeeBodyTermination
- Defined in:
- lib/fern_gusto/types/historical_employee_body_termination.rb
Constant Summary collapse
- OMIT =
Object.new
Instance Attribute Summary collapse
-
#additional_properties ⇒ OpenStruct
readonly
Additional properties unmapped to the current class definition.
-
#effective_date ⇒ String
readonly
Date the employee was terminated from the company.
Class Method Summary collapse
Instance Method Summary collapse
- #initialize(effective_date: OMIT, additional_properties: nil) ⇒ Gusto::HistoricalEmployeeBodyTermination constructor
- #to_json ⇒ String
Constructor Details
#initialize(effective_date: OMIT, additional_properties: nil) ⇒ Gusto::HistoricalEmployeeBodyTermination
20 21 22 23 24 25 26 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 20 def initialize(effective_date: OMIT, additional_properties: nil) @effective_date = effective_date if effective_date != OMIT @additional_properties = additional_properties @_field_set = { "effective_date": effective_date }.reject do | _k, v | v == OMIT end end |
Instance Attribute Details
#additional_properties ⇒ OpenStruct (readonly)
Returns Additional properties unmapped to the current class definition.
10 11 12 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 10 def additional_properties @additional_properties end |
#effective_date ⇒ String (readonly)
Returns Date the employee was terminated from the company.
8 9 10 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 8 def effective_date @effective_date end |
Class Method Details
.from_json(json_object:) ⇒ Gusto::HistoricalEmployeeBodyTermination
31 32 33 34 35 36 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 31 def self.from_json(json_object:) struct = JSON.parse(json_object, object_class: OpenStruct) parsed_json = JSON.parse(json_object) effective_date = parsed_json["effective_date"] new(effective_date: effective_date, additional_properties: struct) end |
.validate_raw(obj:) ⇒ Void
49 50 51 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 49 def self.validate_raw(obj:) obj.effective_date&.is_a?(String) != false || raise("Passed value for field obj.effective_date is not the expected type, validation failed.") end |
Instance Method Details
#to_json ⇒ String
40 41 42 |
# File 'lib/fern_gusto/types/historical_employee_body_termination.rb', line 40 def to_json @_field_set&.to_json end |