Module: Riik::Document::Persistence

Defined in:
lib/riik/document/persistence.rb

Overview

Persistence provides methods for creating and saving documents to Riak.

Defined Under Namespace

Modules: ClassMethods

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(base) ⇒ Object



8
9
10
# File 'lib/riik/document/persistence.rb', line 8

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

Instance Method Details

#destroyBoolean

Destroy the object in Riak.

Returns:

  • (Boolean)


38
39
40
# File 'lib/riik/document/persistence.rb', line 38

def destroy
  robject.delete
end

#saveBoolean

Save the object to Riak.

Returns:

  • (Boolean)


29
30
31
32
# File 'lib/riik/document/persistence.rb', line 29

def save
  robject.data = attributes
  robject.store
end