class Flor::Pro::OnError

Public Instance Methods

pre_execute() click to toggle source
# File lib/flor/pcore/on_error.rb, line 99
def pre_execute

  unatt_unkeyed_children

  @node['atts'] = []
  @node['rets'] = []
end
receive_last() click to toggle source
Calls superclass method Flor::Procedure#receive_last
# File lib/flor/pcore/on_error.rb, line 107
def receive_last

  prc = @node['rets'].find { |r| Flor.is_func_tree?(r) }

  line = tree[2]

  cri = []
  if cla = att('class', 'klass')
    cri << [ 'class', cla, line ]
  end
  if str = @node['rets'].find { |r| r.is_a?(String) }
    cri << [ 'string', str, line ]
  end
  if rex = @node['rets'].find { |r| Flor.is_regex_tree?(r) }
    cri << [ 'regex', *rex[1..-1] ]
  end
  cri << '*' if cri.empty?

  store_on(:error, prc, cri)

  ms = super

  ms.first['from_on'] = 'error'

  ms
end