Class: Raw::Format
- Inherits:
-
Object
- Object
- Raw::Format
- Defined in:
- lib/raw/dispatcher/format.rb
Overview
A REST Resource Representation format.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#content_type ⇒ Object
(also: #mime_type)
The resource content type.
-
#extension ⇒ Object
The default resource extension.
-
#name ⇒ Object
The name of this format.
-
#template_extension ⇒ Object
The default template extension.
Instance Method Summary collapse
-
#after_action(controller, context) ⇒ Object
This callback is called after the action is executed with this format.
-
#before_action(controller, context) ⇒ Object
This callback is called before the action is executed with this format.
-
#filter_template(source) ⇒ Object
Apply filters to the template source.
- #to_s ⇒ Object
Instance Attribute Details
#content_type ⇒ Object Also known as: mime_type
The resource content type. Typically the resource MIME type is used.
14 15 16 |
# File 'lib/raw/dispatcher/format.rb', line 14 def content_type @content_type end |
#extension ⇒ Object
The default resource extension.
19 20 21 |
# File 'lib/raw/dispatcher/format.rb', line 19 def extension @extension end |
#name ⇒ Object
The name of this format.
9 10 11 |
# File 'lib/raw/dispatcher/format.rb', line 9 def name @name end |
#template_extension ⇒ Object
The default template extension.
23 24 25 |
# File 'lib/raw/dispatcher/format.rb', line 23 def template_extension @template_extension end |
Instance Method Details
#after_action(controller, context) ⇒ Object
This callback is called after the action is executed with this format.
46 47 |
# File 'lib/raw/dispatcher/format.rb', line 46 def after_action(controller, context) end |
#before_action(controller, context) ⇒ Object
This callback is called before the action is executed with this format.
40 41 |
# File 'lib/raw/dispatcher/format.rb', line 40 def before_action(controller, context) end |
#filter_template(source) ⇒ Object
Apply filters to the template source. The original template representation must be transformed to executable Ruby code at the end.
33 34 35 |
# File 'lib/raw/dispatcher/format.rb', line 33 def filter_template(source) return source end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/raw/dispatcher/format.rb', line 25 def to_s @name end |