Modules
# ./lib/my_module.rb
module MyModule
def self.included(base)
base.extend(ClassMethods)
end
module ClassMethods
def another_custom
# ...
end
end
def custom(a)
# do sth
end
endclass MyController < ApplicationController
include MyModule
def self.func(*args)
another_custom do |controller, value|
controller.custom(value)
end
end
endLast updated