Class: Preneeds::Race

Inherits:
Base
  • Object
show all
Defined in:
app/models/preneeds/race.rb

Constant Summary collapse

ATTRIBUTE_MAPPING =
{
  'I' => :is_american_indian_or_alaskan_native,
  'A' => :is_asian,
  'B' => :is_black_or_african_american,
  'H' => :is_spanish_hispanic_latino,
  'U' => :not_spanish_hispanic_latino,
  'P' => :is_native_hawaiian_or_other_pacific_islander,
  'W' => :is_white
}.freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#as_json

Methods included from Vets::Model

#attributes, #initialize, #nested_attributes

Methods included from Vets::Attributes

included

Class Method Details

.permitted_paramsObject



33
34
35
# File 'app/models/preneeds/race.rb', line 33

def self.permitted_params
  ATTRIBUTE_MAPPING.values
end

Instance Method Details

#as_eoasObject



19
20
21
22
23
24
25
26
27
28
29
30
31
# File 'app/models/preneeds/race.rb', line 19

def as_eoas
  return_val = []

  ATTRIBUTE_MAPPING.each do |k, v|
    if public_send(v)
      return_val << {
        raceCd: k
      }
    end
  end

  return_val
end