Class: Sawtooth::Rules::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/sawtooth/rules/base.rb

Overview

Base Rule, provides three unimplemented methods, which can be overriden by more specific rules - like the create or call rule etc.

Instance Method Summary collapse

Instance Method Details

#finish(path, document, node) ⇒ Object

Called when the end of a matching XML node is encountered. If an element has no body, this method is called with an empty string instead.

  • path, current (maybe rewritten) path

  • document, the current sawtooth parser stack (‘Sawtooth::Document`)

  • node, the current node



25
26
# File 'lib/sawtooth/rules/base.rb', line 25

def finish(path, document, node)
end

Basically calls inspect



29
# File 'lib/sawtooth/rules/base.rb', line 29

def print_rule; self.class.name end

#start(path, document, node) ⇒ Object

Called when the beginning of a matching XML node is encountered.

  • path, current (maybe rewritten) path

  • document, the current sawtooth parser stack (‘Sawtooth::Document`)

  • node, the current node to process



15
16
# File 'lib/sawtooth/rules/base.rb', line 15

def start(path, document, node)
end