Class: DataMapperRest::Format
- Inherits:
-
Object
- Object
- DataMapperRest::Format
- Defined in:
- lib/dm-rest-adapter/formats.rb
Overview
Absolutely simple format class, extend later if needed
Instance Attribute Summary collapse
-
#extension ⇒ Object
Returns the value of attribute extension.
-
#mime ⇒ Object
Returns the value of attribute mime.
Instance Method Summary collapse
- #header ⇒ Object
-
#initialize(type) ⇒ Format
constructor
A new instance of Format.
Constructor Details
#initialize(type) ⇒ Format
Returns a new instance of Format.
6 7 8 9 |
# File 'lib/dm-rest-adapter/formats.rb', line 6 def initialize(type) @extension = type @mime = "application/#{type}" end |
Instance Attribute Details
#extension ⇒ Object
Returns the value of attribute extension.
4 5 6 |
# File 'lib/dm-rest-adapter/formats.rb', line 4 def extension @extension end |
#mime ⇒ Object
Returns the value of attribute mime.
4 5 6 |
# File 'lib/dm-rest-adapter/formats.rb', line 4 def mime @mime end |
Instance Method Details
#header ⇒ Object
11 12 13 |
# File 'lib/dm-rest-adapter/formats.rb', line 11 def header { 'Content-Type' => @mime } end |