Class: Scalaroid::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/scalaroid/client.rb

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



3
4
5
# File 'lib/scalaroid/client.rb', line 3

def initialize(options={})
  @conn = Scalaroid::TransactionSingleOp.new()
end

Instance Method Details

#get(key) ⇒ Object



7
8
9
10
11
12
13
# File 'lib/scalaroid/client.rb', line 7

def get(key)
  begin
    @conn.read(key)
  rescue Scalaroid::NotFoundError
    nil
  end
end

#set(key, value) ⇒ Object



15
16
17
# File 'lib/scalaroid/client.rb', line 15

def set(key, value)
  @conn.write(key, value)
end