Class: Barkdog::DSL::Context::Monitor::Options
- Inherits:
-
Object
- Object
- Barkdog::DSL::Context::Monitor::Options
- Includes:
- TemplateHelper
- Defined in:
- lib/barkdog/dsl/context/monitor/options.rb
Instance Attribute Summary collapse
-
#result ⇒ Object
readonly
Returns the value of attribute result.
Instance Method Summary collapse
-
#initialize(context, &block) ⇒ Options
constructor
A new instance of Options.
Methods included from TemplateHelper
Constructor Details
#initialize(context, &block) ⇒ Options
Returns a new instance of Options.
4 5 6 7 8 |
# File 'lib/barkdog/dsl/context/monitor/options.rb', line 4 def initialize(context, &block) @context = context.dup @result = {} instance_eval(&block) end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method_name, *args) ⇒ Object (private)
14 15 16 17 18 19 20 21 |
# File 'lib/barkdog/dsl/context/monitor/options.rb', line 14 def method_missing(method_name, *args) if args.length == 1 value = args.first @result[method_name.to_s] = value else super end end |
Instance Attribute Details
#result ⇒ Object (readonly)
Returns the value of attribute result.
10 11 12 |
# File 'lib/barkdog/dsl/context/monitor/options.rb', line 10 def result @result end |