Class: DataMapperRest::Format

Inherits:
Object
  • Object
show all
Defined in:
lib/dm-rest-adapter/formats.rb

Overview

Absolutely simple format class, extend later if needed

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#extensionObject

Returns the value of attribute extension.



4
5
6
# File 'lib/dm-rest-adapter/formats.rb', line 4

def extension
  @extension
end

#mimeObject

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

#headerObject



11
12
13
# File 'lib/dm-rest-adapter/formats.rb', line 11

def header
  { 'Content-Type' => @mime }
end