Q: Call module method from other class So i have one ruby file that is reside inside model > service
module Services

   module SomeJobs


    def mainJob
   ... 
    end
  end
end

and how do i call that method from ruby class that sit inside lib/testfunction.rb
I tried the following and it did not work. any help is appreciate. I am trying to debug the code. 
class TestFunction
  include SomeJobs

  TestFunction::mainJob
end


A: try this out
module Services    
   module SomeJobs    
    def self.mainJob
    end
  end
end

make mainJob a module method, as module instance method are never included in the   including class, they are private to module
class TestFunction
  include Services::SomeJobs
end

now call from
outside this TestFunction class like
TestFunction.new.mainJob

and inside this TestFunction class with
self.class.new.mainJob

if you want to access mainJob as class method then, use extend instead of include.
as you are using IDE debugger 
try requiring that file relative to rails application, in your 
TestFunction Class
