Module: DataMapper::Persevere::JSONSupport::Core

Defined in:
lib/persevere_adapter/json_support/core.rb

Instance Method Summary collapse

Instance Method Details

#to_json(id = nil) ⇒ Object



5
6
7
# File 'lib/persevere_adapter/json_support/core.rb', line 5

def to_json(id = nil)
  to_json_hash(id).to_json
end

#to_json_hash(id = nil) ⇒ Object



9
10
11
12
13
# File 'lib/persevere_adapter/json_support/core.rb', line 9

def to_json_hash(id = nil)
  return {
    'id' => id || self.to_s
  }
end