Module: Ork

Defined in:
lib/ork.rb,
lib/ork/model.rb,
lib/ork/utils.rb,
lib/ork/errors.rb,
lib/ork/connection.rb,
lib/ork/result_set.rb,
lib/ork/model/document.rb,
lib/ork/model/embedded.rb

Defined Under Namespace

Modules: Document, Embeddable, Model, Utils Classes: Connection, Error, IndexNotFound, InvalidClass, NoNextPage, NotEmbeddable, NotOrkObject, ParentMissing, ResultSet, UniqueIndexViolation

Constant Summary collapse

VERSION =
"0.1.5"

Class Method Summary collapse

Class Method Details

.connObject



12
13
14
# File 'lib/ork.rb', line 12

def self.conn
  @conn ||= Ork::Connection.new
end

.connect(context = :main, options = {}) ⇒ Object

Stores the connection options for the Riak instance.

Examples:

Ork.connect(:http_port => 6380, :pb_port => 15000)

All of the options are simply passed on to ‘Riak::Client.new`.



24
25
26
# File 'lib/ork.rb', line 24

def self.connect(context = :main, options = {})
  conn.start(context, options)
end

.riakObject

Use this if you want to do quick ad hoc riak commands against the defined Ork connection.

Examples:

Ork.riak.buckets
Ork.riak.bucket('foo').keys


36
37
38
# File 'lib/ork.rb', line 36

def self.riak
  conn.riak
end