I'm learning about method calling and object oriented programming in
Ruby. The book I'm reading gives an example about calling a method.

I have two methods:

a mainMethod and DOG class.


My mainMethod reads as follows:

require_relative 'dog'
class MAINMETHOD
  DOG.bark
end

My DOG class reads as follows:


class DOG
  def bark
    puts "woof"
  end
end

Whenever I try to run mainMethod, I get "undefined method `bark' for
DOG:Class (NoMethodError)"

Am I doing something wrong? Please help :/

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