Object
Used by on_error when patterns are involved. Gathers much of the pattern logic…
# File lib/ruote/exp/ro_on_x.rb, line 128 def match(regex_or_err) if regex_or_err.is_a?(Regexp) @action.match(regex_or_err) else @pat.match(regex_or_err['message']) || @pat.match(regex_or_err['class']) end end
# File lib/ruote/exp/ro_on_x.rb, line 138 def narrow @action.is_a?(Array) ? @action : self end
# File lib/ruote/exp/ro_on_x.rb, line 123 def split(pat) @action.split(pat) end
# File lib/ruote/exp/ro_on_x.rb, line 143 def update_tree(tree, retries) child = tree[2][@child_id] if @pattern if retries.empty? child[1].delete(@pattern) else child[1][@pattern] = retries.join(', ') end else key, _ = child[1].find { |k, v| v.nil? } child[1].delete(key) child[1][retries.join(', ')] = nil if retries.any? end end
Generated with the Darkfish Rdoc Generator 2.