class RainforestRubyRuntime::DSL

Public Class Methods

new(callback: ) click to toggle source
# File lib/rainforest_ruby_runtime/dsl.rb, line 6
def initialize(callback: )
  @callback = callback
end

Public Instance Methods

define_variable_scope(name, &block) click to toggle source
# File lib/rainforest_ruby_runtime/dsl.rb, line 18
def define_variable_scope(name, &block)
  scope = Variables::Scope.new(name, &block)
  Variables.scope_registry.register(scope)
end
method_missing(name, *args, &block) click to toggle source
Calls superclass method
# File lib/rainforest_ruby_runtime/dsl.rb, line 27
def method_missing(name, *args, &block)
  if Variables.scope_registry.has_variable?(name)
    Variables.scope_registry[name]
  else
    super
  end
end
run_code(code) click to toggle source
# File lib/rainforest_ruby_runtime/dsl.rb, line 23
def run_code(code)
  eval(code)
end
step(options, &block) click to toggle source
# File lib/rainforest_ruby_runtime/dsl.rb, line 14
def step(options, &block)
  RainforestRubyRuntime::Step.new(options.merge(callback: @callback), &block).tap(&:run)
end
test(id: , title: , &block) click to toggle source
# File lib/rainforest_ruby_runtime/dsl.rb, line 10
def test(id: , title: , &block)
  RainforestRubyRuntime::Test.new(id: id, title: title, callback: @callback, &block)
end