Class: Apirelio::Rails::Configuration
- Inherits:
-
Object
- Object
- Apirelio::Rails::Configuration
- Defined in:
- lib/apirelio/rails/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version_header ⇒ Object
Returns the value of attribute api_version_header.
-
#application_resolver ⇒ Object
Returns the value of attribute application_resolver.
-
#batch_size ⇒ Object
Returns the value of attribute batch_size.
-
#capture_headers ⇒ Object
Returns the value of attribute capture_headers.
-
#customer_resolver ⇒ Object
Returns the value of attribute customer_resolver.
-
#enabled ⇒ Object
Returns the value of attribute enabled.
-
#endpoint ⇒ Object
Returns the value of attribute endpoint.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#error_code_resolver ⇒ Object
Returns the value of attribute error_code_resolver.
-
#exclude_routes ⇒ Object
Returns the value of attribute exclude_routes.
-
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
-
#include_routes ⇒ Object
Returns the value of attribute include_routes.
-
#max_queue_size ⇒ Object
Returns the value of attribute max_queue_size.
-
#max_retries ⇒ Object
Returns the value of attribute max_retries.
-
#metadata_keys ⇒ Object
Returns the value of attribute metadata_keys.
-
#metadata_resolver ⇒ Object
Returns the value of attribute metadata_resolver.
-
#release ⇒ Object
Returns the value of attribute release.
-
#service ⇒ Object
Returns the value of attribute service.
-
#timeout ⇒ Object
Returns the value of attribute timeout.
-
#transport ⇒ Object
Returns the value of attribute transport.
Instance Method Summary collapse
- #client_options ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/apirelio/rails/configuration.rb', line 12 def initialize @api_key = ENV.fetch("APIRELIO_API_KEY", "") @service = ENV.fetch("APIRELIO_SERVICE", "rails-api") @endpoint = ENV.fetch("APIRELIO_ENDPOINT", "https://apirelio.com") @environment = ENV.fetch("RAILS_ENV", "production") @release = ENV["APIRELIO_RELEASE"] @enabled = true @batch_size = 100 @flush_interval = 5.0 @max_queue_size = 10_000 @timeout = 2.0 @max_retries = 2 @metadata_keys = [] @include_routes = [] @exclude_routes = [] @customer_resolver = nil @application_resolver = nil @error_code_resolver = nil @metadata_resolver = nil @api_version_header = "HTTP_X_API_VERSION" @capture_headers = %w[HTTP_X_SDK_VERSION HTTP_USER_AGENT] @transport = nil end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def api_key @api_key end |
#api_version_header ⇒ Object
Returns the value of attribute api_version_header.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def api_version_header @api_version_header end |
#application_resolver ⇒ Object
Returns the value of attribute application_resolver.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def application_resolver @application_resolver end |
#batch_size ⇒ Object
Returns the value of attribute batch_size.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def batch_size @batch_size end |
#capture_headers ⇒ Object
Returns the value of attribute capture_headers.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def capture_headers @capture_headers end |
#customer_resolver ⇒ Object
Returns the value of attribute customer_resolver.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def customer_resolver @customer_resolver end |
#enabled ⇒ Object
Returns the value of attribute enabled.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def enabled @enabled end |
#endpoint ⇒ Object
Returns the value of attribute endpoint.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def endpoint @endpoint end |
#environment ⇒ Object
Returns the value of attribute environment.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def environment @environment end |
#error_code_resolver ⇒ Object
Returns the value of attribute error_code_resolver.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def error_code_resolver @error_code_resolver end |
#exclude_routes ⇒ Object
Returns the value of attribute exclude_routes.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def exclude_routes @exclude_routes end |
#flush_interval ⇒ Object
Returns the value of attribute flush_interval.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def flush_interval @flush_interval end |
#include_routes ⇒ Object
Returns the value of attribute include_routes.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def include_routes @include_routes end |
#max_queue_size ⇒ Object
Returns the value of attribute max_queue_size.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def max_queue_size @max_queue_size end |
#max_retries ⇒ Object
Returns the value of attribute max_retries.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def max_retries @max_retries end |
#metadata_keys ⇒ Object
Returns the value of attribute metadata_keys.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def @metadata_keys end |
#metadata_resolver ⇒ Object
Returns the value of attribute metadata_resolver.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def @metadata_resolver end |
#release ⇒ Object
Returns the value of attribute release.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def release @release end |
#service ⇒ Object
Returns the value of attribute service.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def service @service end |
#timeout ⇒ Object
Returns the value of attribute timeout.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def timeout @timeout end |
#transport ⇒ Object
Returns the value of attribute transport.
6 7 8 |
# File 'lib/apirelio/rails/configuration.rb', line 6 def transport @transport end |
Instance Method Details
#client_options ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
# File 'lib/apirelio/rails/configuration.rb', line 36 def { api_key: api_key, service: service, endpoint: endpoint, environment: environment, release: release, enabled: enabled, batch_size: batch_size, flush_interval: flush_interval, max_queue_size: max_queue_size, timeout: timeout, max_retries: max_retries, metadata_keys: , transport: transport } end |