Code :

irb(main):001:0> class Animal
irb(main):002:1>   def bark;end
irb(main):003:1> end
=> nil
irb(main):004:0> class Object
irb(main):005:1>   def foo;end
irb(main):006:1> end
=> nil
irb(main):007:0> Animal.respond_to?(:bark)
=> false
irb(main):008:0> Object.respond_to?(:foo)
=> true
irb(main):009:0>

My question is -

I can see `foo` is an instance method of Object. If so Why does
`Object.respond_to?(:foo)` return `true` ?

if I understand this `Animal.respond_to?(:bark) # => false`, I can't
understand `Object.respond_to?(:foo) # => true` .

-- 
Posted via http://www.ruby-forum.com/.