Class: Utopia::Controller::Respond::Converter::Callback
- Inherits:
-
Struct
- Object
- Struct
- Utopia::Controller::Respond::Converter::Callback
- Defined in:
- lib/utopia/controller/respond.rb
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
Instance Attribute Details
#block ⇒ Object
Returns the value of attribute block
45 46 47 |
# File 'lib/utopia/controller/respond.rb', line 45 def block @block end |
#content_type ⇒ Object
Returns the value of attribute content_type
45 46 47 |
# File 'lib/utopia/controller/respond.rb', line 45 def content_type @content_type end |
Instance Method Details
#call(context, response, media_range) ⇒ Object
54 55 56 57 58 |
# File 'lib/utopia/controller/respond.rb', line 54 def call(context, response, media_range) Converter.update_response(response, headers) do |content| context.instance_exec(content, media_range, &block) end end |
#headers ⇒ Object
46 47 48 |
# File 'lib/utopia/controller/respond.rb', line 46 def headers {HTTP::CONTENT_TYPE => self.content_type} end |
#split(*args) ⇒ Object
50 51 52 |
# File 'lib/utopia/controller/respond.rb', line 50 def split(*args) self.content_type.split(*args) end |