Class: Scalaroid::Client
- Inherits:
-
Object
- Object
- Scalaroid::Client
- Defined in:
- lib/scalaroid/client.rb
Instance Method Summary collapse
- #get(key) ⇒ Object
-
#initialize(options = {}) ⇒ Client
constructor
A new instance of Client.
- #set(key, value) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Returns a new instance of Client.
3 4 5 |
# File 'lib/scalaroid/client.rb', line 3 def initialize(={}) @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 |