From: Kaspar Schiess on 18 May 2010 02:12 Adding to the Array class' instance methods: class Array def my_method end end Array.instance_methods.grep /my_meth/ # => [:my_method] Adding to the Array class itself: class Array # More than one idiom in use here.. def self.my_other_method end end Array.methods.grep /my_oth/ # [:my_other_method] greetings, kaspar
|
Pages: 1 Prev: Opening a stream to multiple (possibly zipped) files Next: fgci -> ruby-fcgi |