Class: Rad::Controller::Abstract::Responder

Inherits:
BasicObject
Defined in:
lib/rad/controller/_abstract/responder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeResponder

Returns a new instance of Responder.



4
5
6
# File 'lib/rad/controller/_abstract/responder.rb', line 4

def initialize
  @handlers = {}
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(m, *args, &block) ⇒ Object (protected)



9
10
11
12
# File 'lib/rad/controller/_abstract/responder.rb', line 9

def method_missing m, *args, &block
  args.must_be.empty
  handlers[m.to_s] = block || lambda{} #.must_be.defined
end

Instance Attribute Details

#handlersObject (readonly)

Returns the value of attribute handlers.



2
3
4
# File 'lib/rad/controller/_abstract/responder.rb', line 2

def handlers
  @handlers
end