Class: Mimas::Config::Options
- Inherits:
-
Object
- Object
- Mimas::Config::Options
- Defined in:
- lib/mimas/config.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Options
constructor
A new instance of Options.
- #method_missing(name, *args, &block) ⇒ Object
Constructor Details
#initialize ⇒ Options
Returns a new instance of Options.
94 95 96 |
# File 'lib/mimas/config.rb', line 94 def initialize @options = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
98 99 100 101 102 103 104 |
# File 'lib/mimas/config.rb', line 98 def method_missing(name, *args, &block) if block @options[name.to_sym] = block.call else @options[name.to_sym] = args.first end end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
92 93 94 |
# File 'lib/mimas/config.rb', line 92 def @options end |
Class Method Details
.evaluate(&block) ⇒ Object
86 87 88 89 90 |
# File 'lib/mimas/config.rb', line 86 def self.evaluate(&block) evaluator = self.new evaluator.instance_exec(&block) evaluator. end |