Class: FdxV660Api::PolicyProductType

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

Overview

Distinguishes options in annuity payouts; values are defined by the carrier. | Value | Description | |-----|-----| | FIXED | Payout is based on a guaranteed rate of return by the carrier | | VARIABLE | Payout is based on the variable performance of the investments the buyer chooses |

Constant Summary collapse

POLICY_PRODUCT_TYPE =
[
  # TODO: Write general description for FIXED
  FIXED = 'FIXED'.freeze,

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

Class Method Summary collapse

Class Method Details

.from_value(value, default_value = FIXED) ⇒ Object



26
27
28
29
30
31
32
33
34
35
36
37
# File 'lib/fdx_v660_api/models/policy_product_type.rb', line 26

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

  str = value.to_s.strip

  case str.downcase
  when 'fixed' then FIXED
  when 'variable' then VARIABLE
  else
    default_value
  end
end

.validate(value) ⇒ Object



20
21
22
23
24
# File 'lib/fdx_v660_api/models/policy_product_type.rb', line 20

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

  true
end