Class: Gusto::MinimumWage

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

Overview

Representation of a Minimum Wage

Constant Summary collapse

OMIT =
Object.new

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uuid:, wage:, wage_type:, effective_date:, authority:, notes: OMIT, additional_properties: nil) ⇒ Gusto::MinimumWage

Parameters:

  • notes (String) (defaults to: OMIT)

    Description of parties the minimum wage applies to.

  • additional_properties (OpenStruct) (defaults to: nil)

    Additional properties unmapped to the current class definition



40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fern_gusto/types/minimum_wage.rb', line 40

def initialize(uuid:, wage:, wage_type:, effective_date:, authority:, notes: OMIT, additional_properties: nil)
  @uuid = uuid
  @wage = wage
  @wage_type = wage_type
  @effective_date = effective_date
  @authority = authority
  @notes = notes if notes != OMIT
  @additional_properties = additional_properties
  @_field_set = { "uuid": uuid, "wage": wage, "wage_type": wage_type, "effective_date": effective_date, "authority": authority, "notes": notes }.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



23
24
25
# File 'lib/fern_gusto/types/minimum_wage.rb', line 23

def additional_properties
  @additional_properties
end

#authorityObject (readonly)

“Federal”.



19
20
21
# File 'lib/fern_gusto/types/minimum_wage.rb', line 19

def authority
  @authority
end

#effective_dateString (readonly)

Returns The date the minimum wage rule is effective on.

Returns:

  • (String)

    The date the minimum wage rule is effective on.



16
17
18
# File 'lib/fern_gusto/types/minimum_wage.rb', line 16

def effective_date
  @effective_date
end

#notesString (readonly)

Returns Description of parties the minimum wage applies to.

Returns:

  • (String)

    Description of parties the minimum wage applies to.



21
22
23
# File 'lib/fern_gusto/types/minimum_wage.rb', line 21

def notes
  @notes
end

#uuidString (readonly)

Returns unique identifier of a minimum wage.

Returns:

  • (String)

    unique identifier of a minimum wage



9
10
11
# File 'lib/fern_gusto/types/minimum_wage.rb', line 9

def uuid
  @uuid
end

#wageString (readonly)

Returns The wage rate for a minimum wage record. Represented as a float, e.g. “15.0”.

Returns:

  • (String)

    The wage rate for a minimum wage record. Represented as a float, e.g. “15.0”.



11
12
13
# File 'lib/fern_gusto/types/minimum_wage.rb', line 11

def wage
  @wage
end

#wage_typeObject (readonly)

“Regular-Industry-Specific”.



14
15
16
# File 'lib/fern_gusto/types/minimum_wage.rb', line 14

def wage_type
  @wage_type
end

Class Method Details

.from_json(json_object:) ⇒ Gusto::MinimumWage

Parameters:

  • json_object (String)

Returns:



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
# File 'lib/fern_gusto/types/minimum_wage.rb', line 56

def self.from_json(json_object:)
  struct = JSON.parse(json_object, object_class: OpenStruct)
  parsed_json = JSON.parse(json_object)
  uuid = parsed_json["uuid"]
  wage = parsed_json["wage"]
  wage_type = parsed_json["wage_type"]
  effective_date = parsed_json["effective_date"]
  authority = parsed_json["authority"]
  notes = parsed_json["notes"]
  new(
    uuid: uuid,
    wage: wage,
    wage_type: wage_type,
    effective_date: effective_date,
    authority: authority,
    notes: notes,
    additional_properties: struct
  )
end

.validate_raw(obj:) ⇒ Void

Parameters:

  • obj (Object)

Returns:

  • (Void)


87
88
89
90
91
92
93
94
# File 'lib/fern_gusto/types/minimum_wage.rb', line 87

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

Instance Method Details

#to_jsonString

Returns:

  • (String)


78
79
80
# File 'lib/fern_gusto/types/minimum_wage.rb', line 78

def to_json
  @_field_set&.to_json
end