Skip to content

Instantly share code, notes, and snippets.

Created April 8, 2016 20:33
Show Gist options
  • Save anonymous/30babc4518f28dc7b15d6ecf3de1bdda to your computer and use it in GitHub Desktop.
Save anonymous/30babc4518f28dc7b15d6ecf3de1bdda to your computer and use it in GitHub Desktop.
module ProjectTypes
def self.assignable_types
ProjectTypes.constants.map{|klass|
[ProjectTypes.const_get(klass)::ENGLISH_NAME, klass]
}
end
end
class ProjectTypes::TypeIII
ENGLISH_NAME = 'Type III'
end
class ProjectTypes::TypeII
ENGLISH_NAME = 'Type II'
end
puts ProjectTypes.available_types
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment