From d94e3ebf1adfd83a356f015c1d56122e601e83c0 Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Mon, 15 Dec 2008 11:51:57 -0500 Subject: Add a couple of helpers to base classes --- state.rb | 13 +++++++++++++ 1 file changed, 13 insertions(+) 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 -- cgit