No description, website, or topics provided.
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
spec
.gitignore
.travis.yml
Gemfile
LICENSE
README.md
Rakefile
superclass_hash.gemspec

README.md

SuperclassHash Build Status

SuperclassHash is a hash that you could use if you are storing values under class keys. If hash does not have particular class key it would serach through superclasses and return the first available value if any.

require "superclass_hash"

class A
end

class B < A
end

superhash = SuperclassHash.new
superhash[A] = "a"
superhash[A] # => "a"
superhash[B] # => "a"