File: README.md

package info (click to toggle)
ruby-instantiator 0.0.6%2Bgit9cbbe70-2
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd, stretch, wheezy
  • size: 152 kB
  • ctags: 101
  • sloc: ruby: 269; makefile: 2
file content (19 lines) | stat: -rw-r--r-- 480 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
## Instantiator

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](https://github.com/floehopper/introspection) project.

### Usage

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

    require "instantiator"
    
    instance = ArbitraryClass.instantiate
    
    p instance.class # => ArbitraryClass