Class: EasydbIo::EasyDB
- Inherits:
-
Object
- Object
- EasydbIo::EasyDB
- Defined in:
- lib/easydb_io.rb
Instance Method Summary collapse
- #delete(key) ⇒ Object
- #get(key) ⇒ Object
-
#initialize(id, token) ⇒ EasyDB
constructor
A new instance of EasyDB.
- #list ⇒ Object
- #put(key, data) ⇒ Object
Constructor Details
#initialize(id, token) ⇒ EasyDB
Returns a new instance of EasyDB.
10 11 12 13 |
# File 'lib/easydb_io.rb', line 10 def initialize(id, token) @id = id @token = token end |
Instance Method Details
#delete(key) ⇒ Object
27 28 29 |
# File 'lib/easydb_io.rb', line 27 def delete(key) conn.delete(key).body end |
#get(key) ⇒ Object
15 16 17 |
# File 'lib/easydb_io.rb', line 15 def get(key) conn.get(key).body end |
#list ⇒ Object
23 24 25 |
# File 'lib/easydb_io.rb', line 23 def list conn.get.body end |
#put(key, data) ⇒ Object
19 20 21 |
# File 'lib/easydb_io.rb', line 19 def put(key, data) conn.post(key, { value: data }.to_json).body end |