Class: EnumFromFile::Storage

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/enum_from_file/storage.rb

Instance Method Summary collapse

Constructor Details

#initializeStorage



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