Instantiate an arbitrary Ruby class
Ruby
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
COPYING.txt
Gemfile
README.md
Rakefile
instantiator.gemspec

README.md

Instantiator Build Status Gem Version

I want to be able to instantiate an arbitrary Ruby class without knowing anything about the constructor.

The initial requirement for this has come from my Introspection project.

Usage

class ArbitraryClass
  def initialize(arg1, arg2, *other_args)
    # stuff
  end
end

require "instantiator"

instance = ArbitraryClass.instantiate

p instance.class # => ArbitraryClass