Class: Levels::LazyEvaluator::DSL
- Inherits:
-
Object
- Object
- Levels::LazyEvaluator::DSL
- Includes:
- MethodMissing, Runtime
- Defined in:
- lib/levels/lazy_evaluator.rb
Overview
This is the class that evaluations Proc values. When you define a value as a Proc, it’s evaluation in the context of an instance of this class.
Constant Summary
Constants included from Runtime
Instance Method Summary collapse
-
#[](group_key) ⇒ Object
Public: Retrieve a group.
-
#defined?(group_key) ⇒ Boolean
Public: Determine if a group exists.
-
#initialize(level) ⇒ DSL
constructor
A new instance of DSL.
Methods included from Runtime
Methods included from MethodMissing
Constructor Details
#initialize(level) ⇒ DSL
Returns a new instance of DSL.
39 40 41 |
# File 'lib/levels/lazy_evaluator.rb', line 39 def initialize(level) @level = level end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Levels::MethodMissing
Instance Method Details
#[](group_key) ⇒ Object
Public: Retrieve a group.
49 50 51 |
# File 'lib/levels/lazy_evaluator.rb', line 49 def [](group_key) @level[group_key] end |
#defined?(group_key) ⇒ Boolean
Public: Determine if a group exists.
44 45 46 |
# File 'lib/levels/lazy_evaluator.rb', line 44 def defined?(group_key) @level.defined?(group_key) end |