Class: Plaid::Branch
- Inherits:
-
Object
- Object
- Plaid::Branch
- Defined in:
- lib/plaid/models/branch.rb
Overview
If the user is currently serving in the US military, the branch of the military they are serving in
Constant Summary collapse
- BRANCH =
[ # TODO: Write general description for ENUM_AIR_FORCE ENUM_AIR_FORCE = 'AIR FORCE'.freeze, # TODO: Write general description for ARMY ARMY = 'ARMY'.freeze, # TODO: Write general description for ENUM_COAST_GUARD ENUM_COAST_GUARD = 'COAST GUARD'.freeze, # TODO: Write general description for MARINES MARINES = 'MARINES'.freeze, # TODO: Write general description for NAVY NAVY = 'NAVY'.freeze ].freeze
Class Method Summary collapse
Class Method Details
.from_value(value, default_value = ENUM_AIR_FORCE) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/plaid/models/branch.rb', line 33 def self.from_value(value, default_value = ENUM_AIR_FORCE) return default_value if value.nil? str = value.to_s.strip case str.downcase when 'enum_air_force' then ENUM_AIR_FORCE when 'army' then ARMY when 'enum_coast_guard' then ENUM_COAST_GUARD when 'marines' then MARINES when 'navy' then NAVY else default_value end end |
.validate(value) ⇒ Object
27 28 29 30 31 |
# File 'lib/plaid/models/branch.rb', line 27 def self.validate(value) return false if value.nil? true end |