obj.methods(all=true) â array
Instance Public methods
Returns a list of the names of public and protected methods of
obj. This will include all the methods accessible in
obj's ancestors. If the all parameter is set to
false
, only those methods in the receiver will be listed.
1 2 3 4 5 6 7 8 9 | class Klass def klass_method() end end k = Klass. new k.methods[ 0 .. 9 ] #=> [:klass_method, :nil?, :===, # :==~, :!, :eql? # :hash, :<=>, :class, :singleton_class] k.methods.length #=> 57 |
Please login to continue.