Module: Constantizer
- Defined in:
- lib/constantizer.rb,
lib/constantizer/version.rb,
lib/constantizer/rack/reloader.rb,
lib/constantizer/integration/sinatra.rb
Defined Under Namespace
Constant Summary collapse
- VERSION =
"1.0.0"
Class Method Summary collapse
Class Method Details
.load!(path) ⇒ Object
6 7 8 9 |
# File 'lib/constantizer.rb', line 6 def self.load!(path) @path = path Dir.glob(File.join(path,'/*.yml')).each { |file| YAML.load_file(file).each { |k, v| Object.const_set k, v } } end |
.reload! ⇒ Object
11 12 13 |
# File 'lib/constantizer.rb', line 11 def self.reload! load! @path end |