Module: Dolly::IdentityProperties

Includes:
ClassMethodsDelegation, DocumentType
Included in:
Document
Defined in:
lib/dolly/identity_properties.rb

Instance Method Summary collapse

Methods included from ClassMethodsDelegation

#connection, #database, #property_clean_doc

Methods included from DocumentType

#base_id, #class_name, included, #name_paramitized, #namespace_key, #namespace_keys, #partitioned?, #set_type, #type_sep, #typed?

Instance Method Details

#idObject



9
10
11
# File 'lib/dolly/identity_properties.rb', line 9

def id
  doc[:_id] ||= namespace_key(connection.uuids.last)
end

#id=(value) ⇒ Object



13
14
15
# File 'lib/dolly/identity_properties.rb', line 13

def id= value
  doc[:_id] = namespace_key(value)
end

#id_as_resourceObject



25
26
27
# File 'lib/dolly/identity_properties.rb', line 25

def id_as_resource
  CGI.escape(id)
end

#revObject



17
18
19
# File 'lib/dolly/identity_properties.rb', line 17

def rev
  doc[:_rev]
end

#rev=(value) ⇒ Object



21
22
23
# File 'lib/dolly/identity_properties.rb', line 21

def rev= value
  doc[:_rev] = value
end