Created
July 5, 2011 14:14
-
-
Save julik/1064909 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
irb(main):010:0> self.class.const_set(:SomeClass, | |
irb(main):011:1* Class.new(Ancestor) do | |
irb(main):012:2* def initialize(var) | |
irb(main):013:3> print "#{self.class} initialized with #{var}" | |
irb(main):014:3> end | |
irb(main):015:2> end | |
irb(main):016:1> ) | |
=> SomeClass | |
irb(main):017:0> SomeClass.new("foo") | |
SomeClass initialized with foo=> #<SomeClass:0x67b77c> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment