Module: SimpleMapper::JsonFormat

Defined in:
lib/simple_mapper/formats/json_format.rb

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/simple_mapper/formats/json_format.rb', line 8

def self.included(base)
  base.extend ClassMethods
end

.mime_type_headersObject



12
13
14
# File 'lib/simple_mapper/formats/json_format.rb', line 12

def self.mime_type_headers
  {'Accept' => 'application/json', 'Content-type' => 'application/json'}
end

Instance Method Details

#metaObject



22
23
24
# File 'lib/simple_mapper/formats/json_format.rb', line 22

def meta
  @meta
end

#to_jsonObject



16
17
18
19
20
# File 'lib/simple_mapper/formats/json_format.rb', line 16

def to_json
  json = Serialize.object_to_json(self, :key_name => 'self').to_s
  # puts "POST JSON: #{json}"
  json
end