summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCasey Dahlin <cdahlin@redhat.com>2008-11-07 15:17:32 -0500
committerCasey Dahlin <cdahlin@redhat.com>2008-11-07 15:17:32 -0500
commita1ee900b937c59d182491d78e1bc2b86545dcfea (patch)
treec905479e346184d30ce49cd5333781120019f6fe
parent174313860aa680c063b7fd2783fe6a7b637d64d4 (diff)
downloadupstate-a1ee900b937c59d182491d78e1bc2b86545dcfea.tar.gz
upstate-a1ee900b937c59d182491d78e1bc2b86545dcfea.tar.xz
upstate-a1ee900b937c59d182491d78e1bc2b86545dcfea.zip
Make names for state classes explicit.
Don't truss ruby to return the correct name for SomeState.class.name when SomeState might be passed around in other constants.
-rw-r--r--state.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/state.rb b/state.rb
index b8e2964..f1387a7 100644
--- a/state.rb
+++ b/state.rb
@@ -233,7 +233,11 @@ class State
newtype.hold_provides = hold_provides
newtype.instance_eval do
undef :new_type, :process_event, :gc, :depsolve_all
+ def name
+ @name
+ end
end
+ newtype.instance_variable_set(:@name, name)
@@state_types.add newtype
newtype.depsolve
newtype