Module: Rad::Controller::Abstract::ClassMethods

Defined in:
lib/rad/controller/_abstract.rb

Instance Method Summary collapse

Instance Method Details

#controller_nameObject



27
28
29
# File 'lib/rad/controller/_abstract.rb', line 27

def controller_name
  self.namespace ? "#{self.namespace.name}::#{self.alias}" : self.alias
end

#helper(*args) ⇒ Object



31
32
33
34
35
36
# File 'lib/rad/controller/_abstract.rb', line 31

def helper *args
  args.to_a.each do |mod|
    mod.must_be.a Module
    context_class.inherit mod
  end
end

#helper_method(*args) ⇒ Object



38
39
40
41
42
43
44
# File 'lib/rad/controller/_abstract.rb', line 38

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