diff options
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/blink/type.rb | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/lib/blink/type.rb b/lib/blink/type.rb index 5a60ee83b..dc23161b8 100644 --- a/lib/blink/type.rb +++ b/lib/blink/type.rb @@ -79,13 +79,16 @@ module Blink #--------------------------------------------------------------- #--------------------------------------------------------------- + def Type.eachtype + @@typeary.each { |type| yield type } + end + #--------------------------------------------------------------- + + #--------------------------------------------------------------- # this should make it so our subclasses don't have to worry about # defining these class instance variables def Type.inherited(sub) - sub.module_eval %q{ - @objects = Hash.new - @actions = Hash.new - } + sub.initvars # add it to the master list # unfortunately we can't yet call sub.name, because the #inherited @@ -96,6 +99,15 @@ module Blink #--------------------------------------------------------------- #--------------------------------------------------------------- + # this is so we don't have to eval this code + # init all of our class instance variables + def Type.initvars + @objects = Hash.new + @actions = Hash.new + end + #--------------------------------------------------------------- + + #--------------------------------------------------------------- # this is used for mapping object types (e.g., Blink::Type::File) # to names (e.g., "file") def Type.name |
