Sha256: ebd2c973a87905f5fe44ac5ad02c883639f2a88acefa05289a4ec8a3d8d4acf7
Contents?: true
Size: 1.03 KB
Versions: 1
Compression:
Stored size: 1.03 KB
Contents
require 'faraday_middleware' module Neoon module Client module Request def cypher(query, parameters = {}) options = { :query => query, :params => parameters } post('/cypher', options) end alias_method :q, :cypher def get(path, options={}) make_request(:get, '/db/data' + path, options) end def post(path, options={}) make_request(:post, '/db/data' + path, options) end def put(path, options={}) make_request(:put, '/db/data' + path, options) end def delete(path, options={}) make_request(:delete, '/db/data' + path, options) end private def make_request(method, path, options) response = connection.send(method) do |request| case method when :get, :delete request.url(path, options) when :post, :put request.path = path request.body = options unless options.empty? end end response.body end end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
neoon-0.0.3 | lib/neoon/client/request.rb |