class Ork::Connection

Attributes

context[RW]
options[RW]

Public Class Methods

new(context = :main, options = {}) click to toggle source
# File lib/ork/connection.rb, line 5
def initialize(context = :main, options = {})
  @context = context
  @options = options
end

Public Instance Methods

reset!() click to toggle source
# File lib/ork/connection.rb, line 10
def reset!
  threaded[context] = nil
end
riak() click to toggle source
# File lib/ork/connection.rb, line 20
def riak
  threaded[context] ||= Riak::Client.new(options)
end
start(context, options = {}) click to toggle source
# File lib/ork/connection.rb, line 14
def start(context, options = {})
  self.context = context
  self.options = options
  self.reset!
end
threaded() click to toggle source
# File lib/ork/connection.rb, line 24
def threaded
  Thread.current[:ork] ||= {}
end