Class: MyTankInfo::Resource
- Inherits:
-
Object
- Object
- MyTankInfo::Resource
show all
- Defined in:
- lib/my_tank_info/resource.rb
Direct Known Subclasses
ActiveAlarmsResource, AlarmHistoryResource, AlarmNotesResource, CsldResultsResource, EnvironmentalSitegroupsResource, InventorySitegroupsResource, LineLeakResultsResource, NotificationContactsResource, NotificationRulesResource, SensorStatusResultsResource, SitegroupInventoryDashboardsResource, TankDailyUsageResource, TankDeliveriesResource, TankInventoryResource, TankLeakResultsResource, TankReconciliationRecordsResource, TankRulesResource, TankRunoutResource, TanksResource, TokensResource
Instance Attribute Summary collapse
Instance Method Summary
collapse
-
#delete_request(url, params: {}, headers: {}) ⇒ Object
-
#get_request(url, params: {}, headers: {}) ⇒ Object
-
#initialize(client) ⇒ Resource
constructor
A new instance of Resource.
-
#patch_request(url, body:, headers: {}) ⇒ Object
-
#post_request(url, body:, headers: {}) ⇒ Object
-
#put_request(url, body:, headers: {}) ⇒ Object
Constructor Details
#initialize(client) ⇒ Resource
Returns a new instance of Resource.
7
8
9
|
# File 'lib/my_tank_info/resource.rb', line 7
def initialize(client)
@client = client
end
|
Instance Attribute Details
Returns the value of attribute client.
5
6
7
|
# File 'lib/my_tank_info/resource.rb', line 5
def client
@client
end
|
Instance Method Details
#delete_request(url, params: {}, headers: {}) ⇒ Object
27
28
29
|
# File 'lib/my_tank_info/resource.rb', line 27
def delete_request(url, params: {}, headers: {})
handle_response client.connection.delete(url, params, .merge())
end
|
#get_request(url, params: {}, headers: {}) ⇒ Object
11
12
13
|
# File 'lib/my_tank_info/resource.rb', line 11
def get_request(url, params: {}, headers: {})
handle_response client.connection.get(url, params, .merge())
end
|
#patch_request(url, body:, headers: {}) ⇒ Object
19
20
21
|
# File 'lib/my_tank_info/resource.rb', line 19
def patch_request(url, body:, headers: {})
handle_response client.connection.patch(url, body, .merge())
end
|
#post_request(url, body:, headers: {}) ⇒ Object
15
16
17
|
# File 'lib/my_tank_info/resource.rb', line 15
def post_request(url, body:, headers: {})
handle_response client.connection.post(url, body, .merge())
end
|
#put_request(url, body:, headers: {}) ⇒ Object
23
24
25
|
# File 'lib/my_tank_info/resource.rb', line 23
def put_request(url, body:, headers: {})
handle_response client.connection.put(url, body, .merge())
end
|