Class: FdxV660Api::SecurityCategory

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

Overview

The type of security

Constant Summary collapse

SECURITY_CATEGORY =
[
  # TODO: Write general description for ANNUITY_SECURITY
  ANNUITY_SECURITY = 'ANNUITY_SECURITY'.freeze,

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

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

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

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

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

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

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

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

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = ANNUITY_SECURITY) ⇒ Object



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

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

  str = value.to_s.strip

  case str.downcase
  when 'annuity_security' then ANNUITY_SECURITY
  when 'bond_security' then BOND_SECURITY
  when 'cd_security' then CD_SECURITY
  when 'debt_security' then DEBT_SECURITY
  when 'digital_asset_security' then DIGITAL_ASSET_SECURITY
  when 'mutual_fund_security' then MUTUAL_FUND_SECURITY
  when 'option_security' then OPTION_SECURITY
  when 'other_security' then OTHER_SECURITY
  when 'stock_security' then STOCK_SECURITY
  when 'sweep_security' then SWEEP_SECURITY
  else
    default_value
  end
end

.validate(value) ⇒ Object



41
42
43
44
45
# File 'lib/fdx_v660_api/models/security_category.rb', line 41

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

  true
end