Class: Grudge::Config::ConfigFile
- Inherits:
-
Object
- Object
- Grudge::Config::ConfigFile
- Defined in:
- lib/grudge/config.rb
Instance Method Summary collapse
-
#initialize(config_file, env = :development) ⇒ ConfigFile
constructor
A new instance of ConfigFile.
- #method_missing(meth, *args, &blk) ⇒ Object
Constructor Details
#initialize(config_file, env = :development) ⇒ ConfigFile
Returns a new instance of ConfigFile.
6 7 8 |
# File 'lib/grudge/config.rb', line 6 def initialize(config_file, env=:development) @env_config = OpenStruct.new(YAML.load(config_file)[env.to_s]) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(meth, *args, &blk) ⇒ Object
10 11 12 |
# File 'lib/grudge/config.rb', line 10 def method_missing(meth, *args, &blk) @env_config.send(meth) end |