Oh yeah. It totally is.
-
Running it
- Type
ruby persistence.rb
— this runs on http://localhost:4567 by default.
- Type
-
Basic CRUD
- Adding keys: POST to
/your/key/name/here
- Getting keys: GET
/your/key/name/here
- Deleting keys: DELETE
/your/key/name/here
- Adding keys: POST to
-
Group operations
- Listing keys: GET
/your/key/namespace/
(trailing slash) - Deleting groups of keys: DELETE
/your/key/namespace/
(trailing slash)
- Listing keys: GET
require 'rest_client'
R = RestClient
puts "Adding /people/1 => " + R.post('http://localhost:4567/people/1', name: "Jason", age: "26")
puts "The contents of /people/1 => " + R.get('http://localhost:4567/people/1')
puts "Available keys: => " + R.get('http://localhost:4567/people/')
puts "Deleting /people/1: => " + R.delete('http://localhost:4567/people/1')
puts "Available keys: => " + R.get('http://localhost:4567/people/')
#### Adding /people/1 => OK
#### The contents of /people/1 => {"name":"Jason","age":"26"}
#### Available keys: => ["/people/1"]
#### Deleting /people/1: => OK
#### Available keys: => []