Class: FdxV660Api::IndustryClassificationSystem

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

Overview

The Industry Classification System containing the industry code for customer. | Value | Description | |-----|-----| | BCLASS | Bloomberg Classification System | | BICS | Bloomberg Industry Classification System | | GICS | Global Industry Classification System | | MOODYS | Moody's Industry Classification | | NAICS | North American Industry Classification System | | OTHER | Any other set of industry classification codes | | SIC | Standard Industry Classification system |

Constant Summary collapse

INDUSTRY_CLASSIFICATION_SYSTEM =
[
  # TODO: Write general description for BCLASS
  BCLASS = 'BCLASS'.freeze,

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = BCLASS) ⇒ Object



49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
# File 'lib/fdx_v660_api/models/industry_classification_system.rb', line 49

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

  str = value.to_s.strip

  case str.downcase
  when 'bclass' then BCLASS
  when 'bics' then BICS
  when 'gics' then GICS
  when 'moodys' then MOODYS
  when 'naics' then NAICS
  when 'other' then OTHER
  when 'sic' then SIC
  else
    default_value
  end
end

.validate(value) ⇒ Object



43
44
45
46
47
# File 'lib/fdx_v660_api/models/industry_classification_system.rb', line 43

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

  true
end