Class: Global::Configuration
- Inherits:
-
Object
- Object
- Global::Configuration
- Extended by:
- Forwardable
- Defined in:
- lib/global/configuration.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
Instance Method Summary collapse
-
#initialize(hash) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(hash) ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 |
# File 'lib/global/configuration.rb', line 12 def initialize(hash) @hash = hash.respond_to?(:with_indifferent_access) ? hash.with_indifferent_access : hash end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &block) ⇒ Object (protected)
18 19 20 |
# File 'lib/global/configuration.rb', line 18 def method_missing(method, *args, &block) key?(method) ? hash[method] : super end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
7 8 9 |
# File 'lib/global/configuration.rb', line 7 def hash @hash end |