Class: Ant::Client::RESTClient
- Inherits:
-
Object
- Object
- Ant::Client::RESTClient
- Defined in:
- lib/ant/client/rest_client.rb
Instance Method Summary collapse
- #delete(path, data = {}) ⇒ Object
- #get(path, data = {}) ⇒ Object
-
#initialize(configs) ⇒ RESTClient
constructor
A new instance of RESTClient.
- #patch(path, data = {}) ⇒ Object
- #post(path, data = {}) ⇒ Object
- #put(path, data = {}) ⇒ Object
- #raw_get(path, data = {}) ⇒ Object
- #raw_post(path, data = {}) ⇒ Object
Constructor Details
#initialize(configs) ⇒ RESTClient
Returns a new instance of RESTClient.
10 11 12 13 14 15 16 |
# File 'lib/ant/client/rest_client.rb', line 10 def initialize(configs) @session = Session.build(configs) @config = configs @format = Format.build(configs) @endpoint = configs[:endpoint] @validator = Validator.build(configs) end |
Instance Method Details
#delete(path, data = {}) ⇒ Object
30 31 32 |
# File 'lib/ant/client/rest_client.rb', line 30 def delete(path, data = {}) perform_request(:delete, path, data) end |
#get(path, data = {}) ⇒ Object
18 19 20 |
# File 'lib/ant/client/rest_client.rb', line 18 def get(path, data = {}) perform_request(:get, path, data) end |
#patch(path, data = {}) ⇒ Object
34 35 36 |
# File 'lib/ant/client/rest_client.rb', line 34 def patch(path, data = {}) perform_request(:patch, path, data) end |
#post(path, data = {}) ⇒ Object
22 23 24 |
# File 'lib/ant/client/rest_client.rb', line 22 def post(path, data = {}) perform_request(:post, path, data) end |
#put(path, data = {}) ⇒ Object
26 27 28 |
# File 'lib/ant/client/rest_client.rb', line 26 def put(path, data = {}) perform_request(:put, path, data) end |
#raw_get(path, data = {}) ⇒ Object
38 39 40 |
# File 'lib/ant/client/rest_client.rb', line 38 def raw_get(path, data = {}) perform_raw_request(:get, path, data) end |
#raw_post(path, data = {}) ⇒ Object
42 43 44 |
# File 'lib/ant/client/rest_client.rb', line 42 def raw_post(path, data = {}) perform_raw_request(:post, path, data) end |