Class: Utopia::Controller::Responder::Handler
- Inherits:
-
Struct
- Object
- Struct
- Utopia::Controller::Responder::Handler
- Defined in:
- lib/utopia/controller/responder.rb
Overview
A content-type handler and its response block.
Instance Attribute Summary collapse
-
#block ⇒ Object
Returns the value of attribute block.
-
#content_type ⇒ Object
Returns the value of attribute content_type.
Instance Method Summary collapse
-
#call(context, request, media_range, *arguments, **options) ⇒ Object
Invoke this handler's block in the controller context.
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
69 70 71 |
# File 'lib/utopia/controller/responder.rb', line 69 def block @block end |
#content_type ⇒ Object
Returns the value of attribute content_type
69 70 71 |
# File 'lib/utopia/controller/responder.rb', line 69 def content_type @content_type end |
Instance Method Details
#call(context, request, media_range, *arguments, **options) ⇒ Object
Invoke this handler's block in the controller context.
77 78 79 |
# File 'lib/utopia/controller/responder.rb', line 77 def call(context, request, media_range, *arguments, **) context.instance_exec(media_range, *arguments, **, &self.block) end |