Class: FlatApi::TeachingTheme
- Inherits:
-
Object
- Object
- FlatApi::TeachingTheme
- Defined in:
- lib/flat_api/models/teaching_theme.rb
Constant Summary collapse
- COMPOSITION =
"composition".freeze
- MUSIC_THEORY =
"music-theory".freeze
- GENERAL_MUSIC =
"general-music".freeze
- BAND =
"band".freeze
- CHOIR =
"choir".freeze
- ORCHESTRA =
"orchestra".freeze
- JAZZ_ENSEMBLE =
"jazz-ensemble".freeze
- MUSIC_TECHNOLOGY =
"music-technology".freeze
- OTHER =
"other".freeze
Class Method Summary collapse
- .all_vars ⇒ Object
-
.build_from_hash(value) ⇒ String
Builds the enum from string.
Instance Method Summary collapse
-
#build_from_hash(value) ⇒ String
Builds the enum from string.
Class Method Details
.all_vars ⇒ Object
28 29 30 |
# File 'lib/flat_api/models/teaching_theme.rb', line 28 def self.all_vars @all_vars ||= [COMPOSITION, MUSIC_THEORY, GENERAL_MUSIC, BAND, CHOIR, ORCHESTRA, JAZZ_ENSEMBLE, MUSIC_TECHNOLOGY, OTHER].freeze end |
.build_from_hash(value) ⇒ String
Builds the enum from string
35 36 37 |
# File 'lib/flat_api/models/teaching_theme.rb', line 35 def self.build_from_hash(value) new.build_from_hash(value) end |
Instance Method Details
#build_from_hash(value) ⇒ String
Builds the enum from string
42 43 44 45 |
# File 'lib/flat_api/models/teaching_theme.rb', line 42 def build_from_hash(value) return value if TeachingTheme.all_vars.include?(value) raise "Invalid ENUM value #{value} for class #TeachingTheme" end |