Class: Veryfi::Configuration
- Inherits:
-
Object
- Object
- Veryfi::Configuration
- Defined in:
- lib/veryfi/configuration.rb
Overview
Process-wide settings used by client to build the shared singleton client. Mirrors the keyword arguments of Veryfi::Client#initialize; defaults match the client's defaults.
Constant Summary collapse
- ATTRS =
%i[ client_id client_secret username api_key base_url api_version timeout faraday ].freeze
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
-
#to_h ⇒ Hash
The configuration as a keyword-arg-ready Hash.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
15 16 17 18 19 |
# File 'lib/veryfi/configuration.rb', line 15 def initialize @base_url = "https://api.veryfi.com/api/" @api_version = "v8" @timeout = 20 end |
Instance Method Details
#to_h ⇒ Hash
Returns the configuration as a keyword-arg-ready Hash. Keys
with nil values are still included; Veryfi.client calls
.compact before passing it to Veryfi::Client#initialize.
24 25 26 |
# File 'lib/veryfi/configuration.rb', line 24 def to_h ATTRS.to_h { |attr| [attr, public_send(attr)] } end |