Class: PingdomClientV3::ResourceCaller
- Inherits:
-
Object
- Object
- PingdomClientV3::ResourceCaller
- Defined in:
- lib/pingdom_client_v3/resource_caller.rb
Instance Method Summary collapse
- #delete(path) ⇒ Object
- #get(path) ⇒ Object
-
#initialize(resource) ⇒ ResourceCaller
constructor
A new instance of ResourceCaller.
- #patch(path, payload = {}) ⇒ Object
- #post(path, payload = {}) ⇒ Object
- #put(path, payload = {}) ⇒ Object
Constructor Details
#initialize(resource) ⇒ ResourceCaller
Returns a new instance of ResourceCaller.
5 6 7 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 5 def initialize(resource) @resource = resource end |
Instance Method Details
#delete(path) ⇒ Object
25 26 27 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 25 def delete(path) wrap_exception { @resource[path].delete } end |
#get(path) ⇒ Object
9 10 11 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 9 def get(path) wrap_exception { @resource[path].get } end |
#patch(path, payload = {}) ⇒ Object
21 22 23 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 21 def patch(path, payload = {}) send_payload(:patch, path, payload) end |
#post(path, payload = {}) ⇒ Object
13 14 15 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 13 def post(path, payload = {}) send_payload(:post, path, payload) end |
#put(path, payload = {}) ⇒ Object
17 18 19 |
# File 'lib/pingdom_client_v3/resource_caller.rb', line 17 def put(path, payload = {}) send_payload(:put, path, payload) end |