Class: EasydbIo::EasyDB

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

Instance Method Summary collapse

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

#listObject



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