Class: Oselvar::Var::Internal::Builder

Inherits:
Object
  • Object
show all
Defined in:
lib/oselvar/var/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



112
113
114
# File 'lib/oselvar/var/internal.rb', line 112

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

#sensor(expression, &handler) ⇒ Object



108
109
110
# File 'lib/oselvar/var/internal.rb', line 108

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

#stimulus(expression, &handler) ⇒ Object



104
105
106
# File 'lib/oselvar/var/internal.rb', line 104

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