Class: Varar::Internal::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/varar/internal.rb

Overview

The block-scoped authoring DSL. A Builder is instance_eval-ed with the steps block, so authors write bare stimulus/sensor/param calls; each delegates to the accumulator above.

Instance Method Summary collapse

Instance Method Details

#param(name, regexp, parse: nil, format: nil) ⇒ Object



111
112
113
# File 'lib/varar/internal.rb', line 111

def param(name, regexp, parse: nil, format: nil)
  Internal.add_custom_type(name, regexp, parse, format)
end

#sensor(expression, &handler) ⇒ Object



107
108
109
# File 'lib/varar/internal.rb', line 107

def sensor(expression, &handler)
  Internal.add_step(expression, handler, 'sensor')
end

#stimulus(expression, &handler) ⇒ Object



103
104
105
# File 'lib/varar/internal.rb', line 103

def stimulus(expression, &handler)
  Internal.add_step(expression, handler, 'stimulus')
end