Class: Signable::Query::Client
- Inherits:
-
Object
- Object
- Signable::Query::Client
- Includes:
- HTTParty
- Defined in:
- lib/signable/query/client.rb
Instance Method Summary collapse
- #all(entry_point, offset, limit) ⇒ Object
- #create(entry_point, object) ⇒ Object
- #delete(entry_poind, id) ⇒ Object
- #find(entry_point, id) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
- #update(entry_point, id, object) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
6 7 8 9 10 |
# File 'lib/signable/query/client.rb', line 6 def initialize self.class.base_uri "https://#{Signable.configuration.base_url}/v1" self.class.basic_auth Signable.configuration.api_key, '' self.class.[:verify] = false end |
Instance Method Details
#all(entry_point, offset, limit) ⇒ Object
12 13 14 15 |
# File 'lib/signable/query/client.rb', line 12 def all(entry_point, offset, limit) response = self.class.get "/#{entry_point}", query: { offset: offset, limit: limit } Response.new response end |
#create(entry_point, object) ⇒ Object
27 28 29 30 |
# File 'lib/signable/query/client.rb', line 27 def create(entry_point, object) response = self.class.post "/#{entry_point}", body: jsonify(object.form_data) Response.new response end |
#delete(entry_poind, id) ⇒ Object
32 33 34 35 |
# File 'lib/signable/query/client.rb', line 32 def delete(entry_poind, id) response = self.class.delete "/#{entry_point}/#{id}" Response.new response end |
#find(entry_point, id) ⇒ Object
17 18 19 20 |
# File 'lib/signable/query/client.rb', line 17 def find(entry_point, id) response = self.class.get "/#{entry_point}/#{id}" Response.new response end |
#update(entry_point, id, object) ⇒ Object
22 23 24 25 |
# File 'lib/signable/query/client.rb', line 22 def update(entry_point, id, object) response = self.class.put "/#{entry_point}/#{id}", body: jsonify(object.form_data) Response.new response end |