Ruby on Rails Thursday, May 19, 2011

Hi,
I want to use module in Rails 3
I have module in /lib directory.

file name: my_module.rb
Code of Module:


module MyModule 
    def self.my_method
      loop do
          puts "I am started!!!"
          sleep 2
      end
    end 
end

Now, I want to use this module in my rb file resides in app_root/daemon directory named myserver.rb

How can i use that?

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.

No comments:

Post a Comment