Sha256: a83105589e53fbeeffb6a6a5ed6b4fdfdc127504c92bf9355f84035f46a36b83
Contents?: true
Size: 1.14 KB
Versions: 12
Compression:
Stored size: 1.14 KB
Contents
module Rad::Controller::Abstract inherit OpenConstructor inherit Rad::Filters inherit Rad::Controller::Abstract::Render, Rad::Controller::Abstract::Miscellaneous inject workspace: :workspace, logger: :logger attr_accessor :action_name attr_required :action_name attr_writer :params def params; @params ||= Rad::Conveyors::Params.new end def call action, *args catch :halt do run_callbacks :action, method: action do send action, *args render action: action end end end module ClassMethods inject workspace: :workspace, logger: :logger def controller_name self.namespace ? "#{self.namespace.name}::#{self.alias}" : self.alias end def helper *args args.to_a.each do |mod| mod.must_be.a Module context_class.inherit mod end end def helper_method *args args = args.first if args.size == 1 and args.first.is_a?(Array) # args.each{|m| m.to_s.must_be.in self.instance_methods} args.each do |m| context_class.delegate m, to: :controller end end end end
Version data entries
12 entries across 12 versions & 1 rubygems