summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/blink/statechange.rb6
-rw-r--r--lib/blink/transaction.rb8
-rw-r--r--lib/blink/type.rb2
-rw-r--r--lib/blink/type/state.rb2
4 files changed, 15 insertions, 3 deletions
diff --git a/lib/blink/statechange.rb b/lib/blink/statechange.rb
index eac0398f0..17aef41fe 100644
--- a/lib/blink/statechange.rb
+++ b/lib/blink/statechange.rb
@@ -32,6 +32,12 @@ module Blink
#---------------------------------------------------------------
#---------------------------------------------------------------
+ def noop
+ return @state.noop
+ end
+ #---------------------------------------------------------------
+
+ #---------------------------------------------------------------
def to_s
return "%s: %s => %s" % [@path,@is,@should]
end
diff --git a/lib/blink/transaction.rb b/lib/blink/transaction.rb
index 7c1258614..d6207f71c 100644
--- a/lib/blink/transaction.rb
+++ b/lib/blink/transaction.rb
@@ -45,7 +45,13 @@ class Blink::Transaction
#---------------------------------------------------------------
def run
- @tree.evaluate(self)
+ if @tree.is_a?(Array)
+ @tree.each { |item|
+ item.evaluate(self)
+ }
+ else
+ @tree.evaluate(self)
+ end
self.evaluate
end
#---------------------------------------------------------------
diff --git a/lib/blink/type.rb b/lib/blink/type.rb
index 28ba60bbd..2357b4495 100644
--- a/lib/blink/type.rb
+++ b/lib/blink/type.rb
@@ -461,7 +461,7 @@ class Blink::Type < Blink::Element
# we always descend into the children before we evaluate our current
# states
def evaluate(transaction)
- self.each { |child| child.evaluate }
+ self.each { |child| child.evaluate(transaction) }
end
#---------------------------------------------------------------
diff --git a/lib/blink/type/state.rb b/lib/blink/type/state.rb
index 25583842f..8433cec6d 100644
--- a/lib/blink/type/state.rb
+++ b/lib/blink/type/state.rb
@@ -37,7 +37,7 @@ class Blink::State < Blink::Element
def evaluate(transaction)
self.retrieve
unless self.insync?
- transaction.change(Blink::StateChange.new(state))
+ transaction.change(Blink::StateChange.new(self))
end
end
#---------------------------------------------------------------