From: Brian Candler Date: 2011-01-26T07:18:24+09:00 Subject: Re: How to call a method from within a module or class. Jason Cameron wrote in post #977476: > module Outer_module > def make_it_a_double(parameter) > return parameter * 2 > end > > puts make_it_a_double(2) > end > > I get the error: > undefined method `make_it_a_double' for Outer_module:Module > (NoMethodError) What you've defined is an instance method (which would be available if you mixed it into a class). What you want is a method on the module itself. Option 1: module Outer_module def self.make_it_a_double(parameter) ... end end Option 2: module Outer_module def make_it_a_double(parameter) ... end module_function :make_it_a_double end -- Posted via http://www.ruby-forum.com/.