Class: Levels::LazyEvaluator::DSL

Inherits:
Object
  • Object
show all
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

Runtime::FileNotFoundError

Instance Method Summary collapse

Methods included from Runtime

#file

Methods included from MethodMissing

#method_missing

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.

Returns:

  • (Boolean)


44
45
46
# File 'lib/levels/lazy_evaluator.rb', line 44

def defined?(group_key)
  @level.defined?(group_key)
end