Class: Veryfi::Request
- Inherits:
-
Object
- Object
- Veryfi::Request
- Defined in:
- lib/veryfi/request.rb
Constant Summary collapse
- VERBS_WITH_BODIES =
%i[post put].freeze
Instance Attribute Summary collapse
-
#api_key ⇒ Object
readonly
Returns the value of attribute api_key.
-
#api_version ⇒ Object
readonly
Returns the value of attribute api_version.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#client_id ⇒ Object
readonly
Returns the value of attribute client_id.
-
#client_secret ⇒ Object
readonly
Returns the value of attribute client_secret.
-
#timeout ⇒ Object
readonly
Returns the value of attribute timeout.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
- #api_url ⇒ Object
- #delete(path) ⇒ Object
- #get(path, params = {}) ⇒ Object
-
#initialize(client_id, client_secret, username, api_key, base_url, api_version, timeout) ⇒ Request
constructor
A new instance of Request.
- #post(path, params) ⇒ Object
- #put(path, params) ⇒ Object
Constructor Details
#initialize(client_id, client_secret, username, api_key, base_url, api_version, timeout) ⇒ Request
Returns a new instance of Request.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/veryfi/request.rb', line 13 def initialize( client_id, client_secret, username, api_key, base_url, api_version, timeout ) @client_id = client_id @client_secret = client_secret @username = username @api_key = api_key @base_url = base_url @api_version = api_version @timeout = timeout end |
Instance Attribute Details
#api_key ⇒ Object (readonly)
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def api_key @api_key end |
#api_version ⇒ Object (readonly)
Returns the value of attribute api_version.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def api_version @api_version end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def base_url @base_url end |
#client_id ⇒ Object (readonly)
Returns the value of attribute client_id.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def client_id @client_id end |
#client_secret ⇒ Object (readonly)
Returns the value of attribute client_secret.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def client_secret @client_secret end |
#timeout ⇒ Object (readonly)
Returns the value of attribute timeout.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def timeout @timeout end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
9 10 11 |
# File 'lib/veryfi/request.rb', line 9 def username @username end |
Instance Method Details
#api_url ⇒ Object
47 48 49 |
# File 'lib/veryfi/request.rb', line 47 def api_url @_api_url ||= [base_url, api_version].join end |
#delete(path) ⇒ Object
43 44 45 |
# File 'lib/veryfi/request.rb', line 43 def delete(path) make_request(:delete, path) end |
#get(path, params = {}) ⇒ Object
31 32 33 |
# File 'lib/veryfi/request.rb', line 31 def get(path, params = {}) make_request(:get, path, params) end |
#post(path, params) ⇒ Object
39 40 41 |
# File 'lib/veryfi/request.rb', line 39 def post(path, params) make_request(:post, path, params) end |
#put(path, params) ⇒ Object
35 36 37 |
# File 'lib/veryfi/request.rb', line 35 def put(path, params) make_request(:put, path, params) end |