Class: ResponseDescriptor
- Inherits:
-
Object
- Object
- ResponseDescriptor
- Includes:
- Hyperion::Headers
- Defined in:
- lib/hyperion/types/response_descriptor.rb
Constant Summary
Constants included from Hyperion::Headers
Hyperion::Headers::ContentTypes
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#version ⇒ Object
readonly
Returns the value of attribute version.
Instance Method Summary collapse
- #as_json(*_args) ⇒ Object
-
#initialize(type, version, format) ⇒ ResponseDescriptor
constructor
A new instance of ResponseDescriptor.
- #to_s ⇒ Object
Methods included from Hyperion::Headers
#content_type_for, #format_for, #route_headers, #short_mimetype
Constructor Details
#initialize(type, version, format) ⇒ ResponseDescriptor
Returns a new instance of ResponseDescriptor.
13 14 15 |
# File 'lib/hyperion/types/response_descriptor.rb', line 13 def initialize(type, version, format) @type, @version, @format = type, version, format end |
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
8 9 10 |
# File 'lib/hyperion/types/response_descriptor.rb', line 8 def format @format end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
8 9 10 |
# File 'lib/hyperion/types/response_descriptor.rb', line 8 def type @type end |
#version ⇒ Object (readonly)
Returns the value of attribute version.
8 9 10 |
# File 'lib/hyperion/types/response_descriptor.rb', line 8 def version @version end |
Instance Method Details
#as_json(*_args) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/hyperion/types/response_descriptor.rb', line 17 def as_json(*_args) { 'type' => type, 'version' => version, 'format' => format.to_s } end |
#to_s ⇒ Object
25 26 27 |
# File 'lib/hyperion/types/response_descriptor.rb', line 25 def to_s short_mimetype(self) end |