Module: DataMapper::Persevere::JSONSupport::Model

Defined in:
lib/persevere_adapter/json_support/model.rb,
lib/persevere_adapter/json_support/model/properties.rb

Defined Under Namespace

Modules: Properties

Instance Method Summary collapse

Instance Method Details

#to_json_hash(repository_name = default_repository_name) ⇒ Object



5
6
7
8
9
10
# File 'lib/persevere_adapter/json_support/model.rb', line 5

def to_json_hash(repository_name = default_repository_name)
  schema_hash = super
  schema_hash['id'] = self.storage_name(repository_name)
  schema_hash['prototype'] ||= {}
  return schema_hash
end

#to_json_schema(repository_name = default_repository_name) ⇒ Object



12
13
14
# File 'lib/persevere_adapter/json_support/model.rb', line 12

def to_json_schema(repository_name = default_repository_name)
  to_json(repository_name)
end

#to_json_schema_hash(repository_name = default_repository_name) ⇒ Object



16
17
18
# File 'lib/persevere_adapter/json_support/model.rb', line 16

def to_json_schema_hash(repository_name = default_repository_name)
  to_json_hash(repository_name)
end