Module: Crystal::AbstractController::Micelaneous

Defined in:
lib/crystal/controller/abstract_controller/micelaneous.rb

Defined Under Namespace

Modules: ClassMethods

Instance Method Summary collapse

Instance Method Details

#respond_to(&block) ⇒ Object

respond_to



7
8
9
10
11
12
13
14
# File 'lib/crystal/controller/abstract_controller/micelaneous.rb', line 7

def respond_to &block
  @_responder.must_be.nil
  @_responder = Responder.new
  block.call @_responder
  handler = @_responder.handlers[params.format]
  raise "Can't respond to #{params.format} format!" unless handler
  handler.call
end