class Quebert::Support::ClassRegistry

Stores classes at retreives a key for class and subclasses. TODO

* make this thing match on most specific subclass

Public Instance Methods

[](key) click to toggle source

Returns a class from a given instance

Calls superclass method
# File lib/quebert/support/registry.rb, line 18
def[](key)
  case key
  when Class
    # Find the class key based on the class or subclass of the incoming key/klass
    if klass = keys.map{|klass| Support.constantize(klass) }.find{|k| k >= key}
      # If we find a matching class/subclass then pull this out
      super klass.name.to_sym
    end
  else
    super
  end
end