From 3b01624e797184fc0e79fbf463bfdd4c3554f8cd Mon Sep 17 00:00:00 2001 From: Casey Dahlin Date: Fri, 10 Oct 2008 10:33:58 -0400 Subject: Add State::get_all method State::get_all gets all states. When the receiver is a subclass of State it returns all states of that type. --- state.rb | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/state.rb b/state.rb index b1f7de0..d8f6458 100644 --- a/state.rb +++ b/state.rb @@ -276,6 +276,11 @@ class State nil end + # Get all states of this type + def State.get_all + @@states.select{ |x| x.is_a? self } + end + # Depsolve all state classes. This method is not defined in subclasses of # State. def State.depsolve_all -- cgit