summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-12-15 11:51:57 -0500
committerCasey Dahlin <cdahlin@redhat.com>2008-12-15 11:51:57 -0500
commitd94e3ebf1adfd83a356f015c1d56122e601e83c0 (patch)
treeffe841f6e7972be3c19cd683da1c163b07ce6e1b
parent5c3a7bf109e55ecae2664032bce47506db36d9a7 (diff)
downloadupstate-d94e3ebf1adfd83a356f015c1d56122e601e83c0.tar.gz
upstate-d94e3ebf1adfd83a356f015c1d56122e601e83c0.tar.xz
upstate-d94e3ebf1adfd83a356f015c1d56122e601e83c0.zip
Add a couple of helpers to base classes
-rw-r--r--state.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/state.rb b/state.rb
index e971843..a15f6b8 100644
--- a/state.rb
+++ b/state.rb
@@ -16,6 +16,19 @@ unless Array.instance_methods.include? "product"
end
end
+class Array
+ # Confirm that this array has no duplicate elements
+ def is_uniq?
+ self == self.uniq
+ end
+end
+
+class Symbol
+ def <=>(other)
+ self.to_s <=> other.to_s
+ end
+end
+
module UpState
# Occurs when the state machine becomes inconsistent