Class: DotHash::Settings
- Inherits:
-
Properties
- Object
- Properties
- DotHash::Settings
- Defined in:
- lib/dot_hash/settings.rb
Class Attribute Summary collapse
-
.instance ⇒ Object
readonly
Returns the value of attribute instance.
Attributes inherited from Properties
Class Method Summary collapse
- .load(*args) ⇒ Object
- .method_missing(*args, &block) ⇒ Object
- .namespace(namespace) ⇒ Object
- .respond_to_missing?(*args) ⇒ Boolean
Instance Method Summary collapse
-
#initialize(*args) ⇒ Settings
constructor
A new instance of Settings.
Methods inherited from Properties
#[], #method_missing, #respond_to_missing?, #to_json, #to_s
Constructor Details
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class DotHash::Properties
Class Attribute Details
.instance ⇒ Object (readonly)
Returns the value of attribute instance.
8 9 10 |
# File 'lib/dot_hash/settings.rb', line 8 def instance @instance end |
Class Method Details
.load(*args) ⇒ Object
18 19 20 |
# File 'lib/dot_hash/settings.rb', line 18 def load(*args) @instance = new(*args) end |
.method_missing(*args, &block) ⇒ Object
10 11 12 |
# File 'lib/dot_hash/settings.rb', line 10 def method_missing(*args, &block) instance.public_send(*args, &block) end |
.namespace(namespace) ⇒ Object
22 23 24 |
# File 'lib/dot_hash/settings.rb', line 22 def namespace(namespace) @instance = @instance[namespace] end |
.respond_to_missing?(*args) ⇒ Boolean
14 15 16 |
# File 'lib/dot_hash/settings.rb', line 14 def respond_to_missing?(*args) instance.respond_to?(*args) end |