Class: Jbr::URL

Inherits:
Object
  • Object
show all
Defined in:
lib/jbr/url.rb

Overview

The page a Jobber user authorizes the app on.

Direct Known Subclasses

Mock::URL

Class Method Summary collapse

Class Method Details

.for(params = {}) ⇒ String

Returns the URL to send the user to.

Parameters:

  • params (Hash) (defaults to: {})

    the redirect_uri and state to come back with.

Returns:

  • (String)

    the URL to send the user to.



6
7
8
9
10
# File 'lib/jbr/url.rb', line 6

def self.for(params = {})
  uri = URI 'https://api.getjobber.com/api/oauth/authorize'
  uri.query = URI.encode_www_form params.merge(response_type: 'code', client_id: client_id)
  uri.to_s
end