Created
September 25, 2008 21:54
-
-
Save deadprogram/12954 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class VitalStatType | |
attr_accessor :title, :value_type. :possible_values | |
end | |
VitalStat::Gender = VitalStatType.new(:title => 'Gender', :value_type => :select, :possible_values => {:male => 'Male', :female => 'Female'}) | |
VitalStat::Age = VitalStatType.new(:title => 'Age', :value_type => :number) | |
VitalStat::Ethnicity = VitalStatType.new(:title => 'Ethnicity', :value_type => :multiple, :possible_values => | |
{ :african_american => 'African American', | |
:american_indian => 'American Indian', | |
:asian => 'Asian', | |
:white => 'White/Caucasian', | |
:east_indian => 'East Indian' | |
}) | |
class VitalStat < ActiveRecord::Base | |
VitalStatTypes = { | |
:gender => [Gender, 1], | |
:age => [Age, 2], | |
:ethnicity => [Ethnicity, 3] | |
} | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment