class Flor::Pro::PatRegex

Public Instance Methods

execute_child(index=0, sub=nil, h=nil) click to toggle source
Calls superclass method Flor::Pro::PatContainer#execute_child
# File lib/flor/pcore/_pat_regex.rb, line 16
def execute_child(index=0, sub=nil, h=nil)

  payload['ret'] = node_payload_ret
    # always pass the noe_payload_ret to children

  super
end
pre_execute() click to toggle source
# File lib/flor/pcore/_pat_regex.rb, line 10
def pre_execute

  @node['rets'] = []
  @node['atts'] = []
end
receive_last() click to toggle source
# File lib/flor/pcore/_pat_regex.rb, line 24
def receive_last

  return wrap_no_match_reply unless val.is_a?(String)

  rex = Flor.to_regex(@node['rets'] + [ att('rxopts') ])
  m = rex.match(val)

  return wrap_no_match_reply unless m

  payload['_pat_binding'] = { 'matched' => val, 'match' => m.to_a }
  payload.delete('_pat_val')

  wrap_reply
end