Class: ITGlue::Client
- Inherits:
-
Object
show all
- Includes:
- HTTParty
- Defined in:
- lib/itglue/client.rb,
lib/itglue/client/mapper.rb,
lib/itglue/client/path_processor.rb
Defined Under Namespace
Classes: Mapper, PathProcessor
Instance Method Summary
collapse
-
#execute(http_method, path, payload = nil, options = {}) ⇒ Object
-
#get(asset_type, path_options = {}, options = {}) ⇒ Object
-
#initialize ⇒ Client
constructor
A new instance of Client.
-
#patch(asset_type, payload, path_options = {}, options = {}) ⇒ Object
-
#post(asset_type, payload, path_options = {}, options = {}) ⇒ Object
Constructor Details
#initialize ⇒ Client
Returns a new instance of Client.
Instance Method Details
#execute(http_method, path, payload = nil, options = {}) ⇒ Object
23
24
25
|
# File 'lib/itglue/client.rb', line 23
def execute(http_method, path, payload = nil, options = {})
process_request(http_method, path, payload, options)
end
|
#get(asset_type, path_options = {}, options = {}) ⇒ Object
27
28
29
30
31
|
# File 'lib/itglue/client.rb', line 27
def get(asset_type, path_options = {}, options = {})
response = process_request(:get, process_path(asset_type, path_options), nil, options)
data = get_remaining_data(response, options)
prepare_data(data)
end
|
#patch(asset_type, payload, path_options = {}, options = {}) ⇒ Object
33
34
35
36
|
# File 'lib/itglue/client.rb', line 33
def patch(asset_type, payload, path_options = {}, options = {})
response = process_request(:patch, process_path(asset_type, path_options), payload, options)
prepare_data(response['data'])
end
|
#post(asset_type, payload, path_options = {}, options = {}) ⇒ Object
38
39
40
41
|
# File 'lib/itglue/client.rb', line 38
def post(asset_type, payload, path_options = {}, options = {})
response = process_request(:post, process_path(asset_type, path_options), payload, options)
prepare_data(response['data'])
end
|