Module: Leadcli::Routes
- Included in:
- ApiCaller
- Defined in:
- lib/leadcli/routes.rb
Instance Method Summary collapse
- #create_endpoint(options) ⇒ Object
- #create_url(options = {}) ⇒ Object
- #delete_endpoint(options) ⇒ Object
- #delete_url(options) ⇒ Object
Instance Method Details
#create_endpoint(options) ⇒ Object
4 5 6 |
# File 'lib/leadcli/routes.rb', line 4 def create_endpoint() [:post, create_url()] end |
#create_url(options = {}) ⇒ Object
8 9 10 11 12 |
# File 'lib/leadcli/routes.rb', line 8 def create_url(={}) url = http_scheme.build(.merge(path: create_path)) url.query = [:query].map { |k,v| "#{k}=#{v}" }.join('&') if [:query] url.to_s end |
#delete_endpoint(options) ⇒ Object
14 15 16 |
# File 'lib/leadcli/routes.rb', line 14 def delete_endpoint() [:delete, delete_url()] end |
#delete_url(options) ⇒ Object
18 19 20 21 |
# File 'lib/leadcli/routes.rb', line 18 def delete_url() url = http_scheme.build(.merge(path: delete_path([:id]))) url.to_s end |