Guest User

Untitled

a guest
Feb 20th, 2018
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. class VitalStatType
  2. attr_accessor :title, :possible_values
  3.  
  4. def conditions
  5. end
  6. end
  7.  
  8. class VitalStatSelectType < VitalStatType
  9. def conditions
  10. end
  11. end
  12.  
  13. class VitalStatMultipleSelectType < VitalStatType
  14. def conditions
  15. end
  16. end
  17.  
  18. class VitalStatNumberType < VitalStatType
  19. def conditions
  20. end
  21. end
  22.  
  23.  
  24. VitalStat::Gender = VitalStatSelectType.new(:title => 'Gender', :possible_values => {:male => 'Male', :female => 'Female'})
  25. VitalStat::Age = VitalStatNumberType.new(:title => 'Age')
  26. VitalStat::Ethnicity = VitalStatMultipleSelectType.new(:title => 'Ethnicity', :possible_values =>
  27. { :african_american => 'African American',
  28. :american_indian => 'American Indian',
  29. :asian => 'Asian',
  30. :white => 'White/Caucasian',
  31. :east_indian => 'East Indian'
  32. })
  33.  
  34.  
  35. class VitalStat < ActiveRecord::Base
  36. VitalStatTypes = {
  37. :gender => [Gender, 1],
  38. :age => [Age, 2],
  39. :ethnicity => [Ethnicity, 3]
  40. }
  41.  
  42. end
Add Comment
Please, Sign In to add comment