Class: MoonlogsRuby::Role
- Inherits:
-
Object
- Object
- MoonlogsRuby::Role
- Defined in:
- lib/moonlogs-ruby/models/role.rb
Constant Summary collapse
- MEMBER =
'Member'.freeze
- ADMIN =
'Admin'.freeze
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ String
Builds the enum from string.
Instance Method Details
#build_from_hash(value) ⇒ String
Builds the enum from string
22 23 24 25 26 |
# File 'lib/moonlogs-ruby/models/role.rb', line 22 def build_from_hash(value) constantValues = Role.constants.select { |c| Role::const_get(c) == value } raise "Invalid ENUM value #{value} for class #Role" if constantValues.empty? value end |