Class: Kvom::Adapter::Document
- Inherits:
-
Object
- Object
- Kvom::Adapter::Document
show all
- Defined in:
- lib/kvom/adapter/document.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#key ⇒ Object
Returns the value of attribute key.
8
9
10
|
# File 'lib/kvom/adapter/document.rb', line 8
def key
@key
end
|
#persisted_revision ⇒ Object
Returns the value of attribute persisted_revision.
8
9
10
|
# File 'lib/kvom/adapter/document.rb', line 8
def persisted_revision
@persisted_revision
end
|
Instance Method Details
#[](name) ⇒ Object
10
11
12
|
# File 'lib/kvom/adapter/document.rb', line 10
def [](name)
attributes[name]
end
|
#[]=(name, value) ⇒ Object
14
15
16
|
# File 'lib/kvom/adapter/document.rb', line 14
def []=(name, value)
attributes[name] = value
end
|
#update_revision ⇒ Object
18
19
20
21
22
|
# File 'lib/kvom/adapter/document.rb', line 18
def update_revision
attributes["@rev"] = SecureRandom.hex(8)
yield
@persisted_revision = attributes["@rev"]
end
|