Class: EnumFromFile::Storage
- Inherits:
-
Object
- Object
- EnumFromFile::Storage
- Includes:
- Singleton
- Defined in:
- lib/enum_from_file/storage.rb
Instance Method Summary collapse
-
#initialize ⇒ Storage
constructor
A new instance of Storage.
- #values_from(file:) ⇒ Object
Constructor Details
#initialize ⇒ Storage
7 8 9 |
# File 'lib/enum_from_file/storage.rb', line 7 def initialize enum_files.each(&method(:define_enum)) end |
Instance Method Details
#values_from(file:) ⇒ Object
11 12 13 14 15 |
# File 'lib/enum_from_file/storage.rb', line 11 def values_from(file:) send(file) rescue NoMethodError raise StandardError, "Cannot read 'config/enums/#{method_name}.yml'" end |