Module: EcfDgii
- Defined in:
- lib/ecf-dgii.rb,
lib/ecf_dgii/client.rb,
lib/ecf_dgii/polling.rb,
lib/ecf_dgii/railtie.rb,
lib/ecf_dgii/version.rb,
lib/ecf_dgii/exceptions.rb,
lib/ecf_dgii/frontend_client.rb,
lib/ecf_dgii/generators/ecf_dgii/install_generator.rb
Defined Under Namespace
Modules: Generated, Generators, Polling Classes: Client, Configuration, EcfError, FrontendClient, PollingMaxRetriesError, PollingOptions, PollingTimeoutError, Railtie
Constant Summary collapse
- VERSION =
SDK Version
"1.1.0"- PollingError =
Deprecated.
Use EcfError instead. Kept for backward compatibility.
EcfError
Class Attribute Summary collapse
-
.configuration ⇒ Object
Returns the value of attribute configuration.
Class Method Summary collapse
- .client ⇒ Object
- .configure {|configuration| ... } ⇒ Object
-
.create_frontend_client(get_token:, cache_token: nil, get_cached_token: nil, base_url: nil, environment: :test, timeout: 30) ⇒ EcfDgii::FrontendClient
Factory that creates a restricted read-only client suitable for frontend use.
Class Attribute Details
.configuration ⇒ Object
Returns the value of attribute configuration.
11 12 13 |
# File 'lib/ecf-dgii.rb', line 11 def configuration @configuration end |
Class Method Details
.client ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/ecf-dgii.rb', line 20 def self.client @client ||= Client.new( api_key: configuration&.api_key, base_url: configuration&.base_url, environment: configuration&.environment || :test, timeout: configuration&.timeout || 30 ) end |
.configure {|configuration| ... } ⇒ Object
14 15 16 17 18 |
# File 'lib/ecf-dgii.rb', line 14 def self.configure self.configuration ||= Configuration.new yield(configuration) @client = nil end |
.create_frontend_client(get_token:, cache_token: nil, get_cached_token: nil, base_url: nil, environment: :test, timeout: 30) ⇒ EcfDgii::FrontendClient
Factory that creates a restricted read-only client suitable for frontend use. Only GET endpoints are exposed.
206 207 208 209 210 211 212 213 214 215 216 |
# File 'lib/ecf_dgii/frontend_client.rb', line 206 def self.create_frontend_client(get_token:, cache_token: nil, get_cached_token: nil, base_url: nil, environment: :test, timeout: 30) FrontendClient.new( get_token: get_token, cache_token: cache_token, get_cached_token: get_cached_token, base_url: base_url, environment: environment, timeout: timeout ) end |