rails_module.rb |
|
---|---|
This guide applies to a Ruby on Rails Module. It is part of Jo Hund’s Software Engineering Guide. |
|
Store modules in |
|
Add the below to your auto_load_paths in application.rb:
|
module NewModule
def self.included(base)
base.extend ClassMethods
end
module ClassMethods
def a_class_method
puts "a_class_method"
end
end
def an_instance_method
puts "an_instance_method"
end
end |