Module: Rebrandly::Client
- Defined in:
- lib/rebrandly_client.rb
Constant Summary collapse
- API_VERSION =
'v1'.freeze
- BASE_URL =
"https://api.rebrandly.com/#{API_VERSION}".freeze
Class Method Summary collapse
- .delete(end_point, options = {}) ⇒ Object
- .get(end_point, options = {}) ⇒ Object
- .post(end_point, options = {}) ⇒ Object
Class Method Details
.delete(end_point, options = {}) ⇒ Object
23 24 25 26 27 |
# File 'lib/rebrandly_client.rb', line 23 def delete(end_point, = {}) wrap_request(end_point, ) do |url, , | HTTParty.delete(url, ) end end |
.get(end_point, options = {}) ⇒ Object
11 12 13 14 15 |
# File 'lib/rebrandly_client.rb', line 11 def get(end_point, = {}) wrap_request(end_point, ) do |url, , | HTTParty.get(url, .merge(query: )) end end |
.post(end_point, options = {}) ⇒ Object
17 18 19 20 21 |
# File 'lib/rebrandly_client.rb', line 17 def post(end_point, = {}) wrap_request(end_point, ) do |url, , | HTTParty.post(url, .merge(body: .to_json)) end end |