Module: Kestrel::Config
Defined Under Namespace
Classes: ConfigNotLoaded
Instance Attribute Summary collapse
-
#config ⇒ Object
Returns the value of attribute config.
-
#environment ⇒ Object
Returns the value of attribute environment.
Instance Method Summary collapse
- #default ⇒ Object
- #load(config_file) ⇒ Object
- #namespace(namespace) ⇒ Object (also: #method_missing)
- #new_client(space = nil) ⇒ Object
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing ⇒ Object
35 36 37 |
# File 'lib/kestrel/config.rb', line 35 def namespace(namespace) client_args_from config[namespace.to_s][environment.to_s] end |
Instance Attribute Details
#config ⇒ Object
Returns the value of attribute config.
9 10 11 |
# File 'lib/kestrel/config.rb', line 9 def config @config end |
#environment ⇒ Object
Returns the value of attribute environment.
9 10 11 |
# File 'lib/kestrel/config.rb', line 9 def environment @environment end |
Instance Method Details
#default ⇒ Object
27 28 29 |
# File 'lib/kestrel/config.rb', line 27 def default client_args_from config[environment.to_s] end |
#load(config_file) ⇒ Object
11 12 13 |
# File 'lib/kestrel/config.rb', line 11 def load(config_file) self.config = YAML.load_file(config_file) end |
#namespace(namespace) ⇒ Object Also known as: method_missing
23 24 25 |
# File 'lib/kestrel/config.rb', line 23 def namespace(namespace) client_args_from config[namespace.to_s][environment.to_s] end |