Class: Sawtooth::Rules::DelegateRule::CallbacksRule

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from Base

#print_rule

Constructor Details

#initialize(delegate) ⇒ CallbacksRule

Returns a new instance of CallbacksRule.



17
# File 'lib/sawtooth/rules/delegate_rule.rb', line 17

def initialize(delegate); @delegate = delegate end

Instance Attribute Details

#delegateObject (readonly)

Returns the value of attribute delegate.



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

def delegate
  @delegate
end

Instance Method Details

#finish(path, doc, node) ⇒ Object



23
24
25
26
# File 'lib/sawtooth/rules/delegate_rule.rb', line 23

def finish(path, doc, node)
  rule = @delegate.rules && @delegate.rules.find('@document:after')
  rule.finish(path, doc, node) if rule && rule.respond_to?(:finish)
end

#start(path, doc, node) ⇒ Object



18
19
20
21
# File 'lib/sawtooth/rules/delegate_rule.rb', line 18

def start(path, doc, node)
  rule = @delegate.rules && @delegate.rules.find('@document:before')
  rule.start(path, doc, node) if rule && rule.respond_to?(:start)
end