Class: Settings::Config
- Inherits:
-
Object
- Object
- Settings::Config
- Includes:
- Provider
- Defined in:
- lib/configurates.rb
Defined Under Namespace
Classes: NoBlockGiven
Instance Attribute Summary collapse
-
#root ⇒ Object
readonly
Returns the value of attribute root.
Class Method Summary collapse
-
.create(&callback) ⇒ Object
Currently provider(s) can be registered only when we creating new instance based on Settings:Config class.
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(msg, *args, &blk) ⇒ Object (private)
Provide message redirect in the @root (storage) if it’s possible.
77 78 79 |
# File 'lib/configurates.rb', line 77 def method_missing(msg, *args, &blk) (msg) ? @root.send(msg, *args, &blk) : super end |
Instance Attribute Details
#root ⇒ Object (readonly)
Returns the value of attribute root.
50 51 52 |
# File 'lib/configurates.rb', line 50 def root @root end |
Class Method Details
.create(&callback) ⇒ Object
Currently provider(s) can be registered only when we creating new instance based on Settings:Config class. It means self.create should be a higher function.
59 60 61 62 63 |
# File 'lib/configurates.rb', line 59 def self.create(&callback) msg = 'Provider not being chosen' raise NoBlockGiven, msg unless block_given? new(&callback) end |