Class: Tropeco::Configurations
- Inherits:
-
Object
- Object
- Tropeco::Configurations
- Includes:
- Singleton
- Defined in:
- lib/tropeco/configurations.rb
Instance Attribute Summary collapse
-
#configs ⇒ Object
Returns the value of attribute configs.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Configurations
constructor
A new instance of Configurations.
- #method_missing(method, *args) ⇒ Object
Constructor Details
#initialize ⇒ Configurations
Returns a new instance of Configurations.
15 16 17 |
# File 'lib/tropeco/configurations.rb', line 15 def initialize() @configs = YAML.load_file('config.yaml') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args) ⇒ Object
19 20 21 |
# File 'lib/tropeco/configurations.rb', line 19 def method_missing(method, *args) return @configs[method.to_s] end |
Instance Attribute Details
#configs ⇒ Object
Returns the value of attribute configs.
8 9 10 |
# File 'lib/tropeco/configurations.rb', line 8 def configs @configs end |
Class Method Details
.get_config ⇒ Object
11 12 13 |
# File 'lib/tropeco/configurations.rb', line 11 def self.get_config() return self.instance end |