Class: FdxV660Api::EmploymentType2

Inherits:
Object
  • Object
show all
Defined in:
lib/fdx_v660_api/models/employment_type2.rb

Overview

The employee's employment type, CONTRACTED, FULL-TIME, OTHER, PART-TIME, SEASONAL, TEMPORARY

Constant Summary collapse

EMPLOYMENT_TYPE2 =
[
  # TODO: Write general description for CONTRACTED
  CONTRACTED = 'CONTRACTED'.freeze,

  # TODO: Write general description for FULL_TIME
  FULL_TIME = 'FULL_TIME'.freeze,

  # TODO: Write general description for OTHER
  OTHER = 'OTHER'.freeze,

  # TODO: Write general description for PART_TIME
  PART_TIME = 'PART_TIME'.freeze,

  # TODO: Write general description for SEASONAL
  SEASONAL = 'SEASONAL'.freeze,

  # TODO: Write general description for TEMPORARY
  TEMPORARY = 'TEMPORARY'.freeze
].freeze

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = CONTRACTED) ⇒ Object



36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/fdx_v660_api/models/employment_type2.rb', line 36

def self.from_value(value, default_value = CONTRACTED)
  return default_value if value.nil?

  str = value.to_s.strip

  case str.downcase
  when 'contracted' then CONTRACTED
  when 'full_time' then FULL_TIME
  when 'other' then OTHER
  when 'part_time' then PART_TIME
  when 'seasonal' then SEASONAL
  when 'temporary' then TEMPORARY
  else
    default_value
  end
end

.validate(value) ⇒ Object



30
31
32
33
34
# File 'lib/fdx_v660_api/models/employment_type2.rb', line 30

def self.validate(value)
  return false if value.nil?

  true
end