Class: Crystal::AbstractController::Responder
- Inherits:
- BasicObject
- Defined in:
- lib/crystal/controller/abstract_controller/responder.rb
Instance Attribute Summary collapse
-
#handlers ⇒ Object
readonly
Returns the value of attribute handlers.
Instance Method Summary collapse
-
#initialize ⇒ Responder
constructor
A new instance of Responder.
Constructor Details
#initialize ⇒ Responder
Returns a new instance of Responder.
6 7 8 |
# File 'lib/crystal/controller/abstract_controller/responder.rb', line 6 def initialize @handlers = {} end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(m, *args, &block) ⇒ Object (protected)
11 12 13 14 |
# File 'lib/crystal/controller/abstract_controller/responder.rb', line 11 def method_missing m, *args, &block args.must_be.empty handlers[m.to_s] = block.must_be.defined end |
Instance Attribute Details
#handlers ⇒ Object (readonly)
Returns the value of attribute handlers.
4 5 6 |
# File 'lib/crystal/controller/abstract_controller/responder.rb', line 4 def handlers @handlers end |