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
47 48 49 |
# File 'lib/utopia/controller/respond.rb', line 47 def block @block end |
#content_type ⇒ Object
Returns the value of attribute content_type
47 48 49 |
# File 'lib/utopia/controller/respond.rb', line 47 def content_type @content_type end |
Instance Method Details
#call(context, response, media_range) ⇒ Object
56 57 58 59 60 |
# File 'lib/utopia/controller/respond.rb', line 56 def call(context, response, media_range) Converter.update_response(response, headers) do |content| context.instance_exec(content, media_range, &block) end end |
#headers ⇒ Object
48 49 50 |
# File 'lib/utopia/controller/respond.rb', line 48 def headers {HTTP::CONTENT_TYPE => self.content_type} end |
#split(*args) ⇒ Object
52 53 54 |
# File 'lib/utopia/controller/respond.rb', line 52 def split(*args) self.content_type.split(*args) end |