module ActionHandler::HandlerExtension
Public Instance Methods
action_methods(*method_names)
click to toggle source
# File lib/action_handler/equip.rb, line 42 def action_methods(*method_names) ActionHandler::Config.get(self).action_methods = method_names end
arg(name, &block)
click to toggle source
# File lib/action_handler/equip.rb, line 61 def arg(name, &block) unless block_given? raise '`arg` requires block. Use `args` to register arguments supplier object' end ActionHandler::Config.get(self).add_arg(name, &block) end
args(*suppliers)
click to toggle source
# File lib/action_handler/equip.rb, line 46 def args(*suppliers) raise '`args` does not accept block. Use `arg` to define custom argument' if block_given? config = ActionHandler::Config.get(self) suppliers.each do |supplier| config.add_args_supplier(supplier) end end
args_params(*names)
click to toggle source
# File lib/action_handler/equip.rb, line 55 def args_params(*names) ActionHandler::Config.get(self).add_args_supplier( ActionHandler::Args::Params.new(*names), ) end
as_controller(&block)
click to toggle source
# File lib/action_handler/equip.rb, line 38 def as_controller(&block) ActionHandler::Config.get(self).as_controller = block end