Hello
I was wondering if anyone can help me by explaining what governs the
order of methods returned by object.public_methods( false ) ?
class Test
def a
end
def b
end
def c
end
end
t = Test.new
t.public_methods( false ) # => ["a", "c", "b"]
.... so appears to be neither in the order defined, nor alphabetical and
not random either?
Thanks
Tom
ts1
(ts)
2
I was wondering if anyone can help me by explaining what governs the
order of methods returned by object.public_methods( false ) ?
methods are stored in an hash, where the key is the id of the method
name.
Guy Decoux
Phlip4
(Phlip)
3
Tom Counsell wrote:
t.public_methods( false ) # => ["a", "c", "b"]
... so appears to be neither in the order defined, nor alphabetical and
not random either?
To supplement the other answer:
def doc(anObject)
puts(anObject.class.name)
itsMethods = anObject.public_methods() -
Object.new().public_methods()
puts(itsMethods.sort()) if !itsMethods.nil?
end
I use that for a manual version of "intellisense", those annoying popups
that some editors use to tell you what to type next.
···
--
Phlip
http://industrialxp.org/community/bin/view/Main/TestFirstUserInterfaces
Thanks
Tom
If you are using this in irb, require 'irb/completion' and hit the
<TAB> key after your method dots.
···
On 2004-09-12 22:24:58 +0900, Phlip wrote:
I use that for a manual version of "intellisense", those annoying popups
that some editors use to tell you what to type next.
--
lambda { |c| lambda { |f| f[f] } [ lambda { |f| c[lambda { |x| f[f] } ] }] }