Class: Gusto::HistoricalEmployeeBodyJob

Inherits:
Object
  • Object
show all
Defined in:
lib/fern_gusto/types/historical_employee_body_job.rb

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hire_date: OMIT, additional_properties: nil) ⇒ Gusto::HistoricalEmployeeBodyJob

Parameters:

  • hire_date (String) (defaults to: OMIT)

    The date when the employee was hired to the company

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



20
21
22
23
24
25
26
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 20

def initialize(hire_date: OMIT, additional_properties: nil)
  @hire_date = hire_date if hire_date != OMIT
  @additional_properties = additional_properties
  @_field_set = { "hire_date": hire_date }.reject do | _k, v |
  v == OMIT
end
end

Instance Attribute Details

#additional_propertiesOpenStruct (readonly)

Returns Additional properties unmapped to the current class definition.

Returns:

  • (OpenStruct)

    Additional properties unmapped to the current class definition



10
11
12
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 10

def additional_properties
  @additional_properties
end

#hire_dateString (readonly)

Returns The date when the employee was hired to the company.

Returns:

  • (String)

    The date when the employee was hired to the company



8
9
10
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 8

def hire_date
  @hire_date
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::HistoricalEmployeeBodyJob

Parameters:

  • json_object (String)

Returns:



31
32
33
34
35
36
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 31

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  hire_date = parsed_json["hire_date"]
  new(hire_date: hire_date, additional_properties: struct)
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


49
50
51
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 49

def self.validate_raw(obj:)
  obj.hire_date&.is_a?(String) != false || raise("Passed value for field obj.hire_date is not the expected type, validation failed.")
end

Instance Method Details

#to_jsonString

Returns:

  • (String)


40
41
42
# File 'lib/fern_gusto/types/historical_employee_body_job.rb', line 40

def to_json
  @_field_set&.to_json
end