Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Archive
Ruby
Adding instance methods to class at runtime
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="Jon A. Lambert, post: 4481580"] I want to add instance methods to a class at runtine. $ cat testcmds.rb module Bar def hello puts "hello called" end end class Foo end Foo.include(Bar) Foo.new.hello $ ruby testcmds.rb testcmds.rb:10: private method `include' called for Foo:Class (NoMethodError) How can I do this? [/QUOTE]
Verification
Post reply
Forums
Archive
Archive
Ruby
Adding instance methods to class at runtime
Top