Class: IronBank::Configuration
- Inherits:
-
Object
- Object
- IronBank::Configuration
- Defined in:
- lib/iron_bank/configuration.rb
Overview
The Zuora configuration class.
Instance Attribute Summary collapse
-
#api_minor_version ⇒ Object
Specify a minor version.
-
#auth_type ⇒ Object
Auth type (cookie|token).
-
#cache ⇒ Object
Cache store instance, optionally used by certain resources.
-
#client_id ⇒ Object
OAuth client ID associated with our platform admin user.
-
#client_secret ⇒ Object
OAuth client secret.
-
#domain ⇒ Object
The Zuora domain for our tenant (apisandbox, production, etc.).
-
#excluded_fields_file ⇒ Object
File path for excluded fields (when querying using ZOQL).
-
#export_directory ⇒ Object
Directory where the local records are exported.
-
#logger ⇒ Object
Logger.
-
#middlewares ⇒ Object
middlewares.
-
#schema_directory ⇒ Object
Directory where the XML describe files are located.
-
#users_file ⇒ Object
File path for Zuora users export.
Instance Method Summary collapse
- #credentials ⇒ Object
- #credentials? ⇒ Boolean
- #excluded_fields ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #retry_options ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
43 44 45 46 47 48 49 50 |
# File 'lib/iron_bank/configuration.rb', line 43 def initialize @schema_directory = "./config/schema" @export_directory = "./config/export" @logger = IronBank::Logger.new @auth_type = "token" @middlewares = [] @api_minor_version = "211.0" end |
Instance Attribute Details
#api_minor_version ⇒ Object
Specify a minor version
41 42 43 |
# File 'lib/iron_bank/configuration.rb', line 41 def api_minor_version @api_minor_version end |
#auth_type ⇒ Object
Auth type (cookie|token)
23 24 25 |
# File 'lib/iron_bank/configuration.rb', line 23 def auth_type @auth_type end |
#cache ⇒ Object
Cache store instance, optionally used by certain resources.
26 27 28 |
# File 'lib/iron_bank/configuration.rb', line 26 def cache @cache end |
#client_id ⇒ Object
OAuth client ID associated with our platform admin user.
17 18 19 |
# File 'lib/iron_bank/configuration.rb', line 17 def client_id @client_id end |
#client_secret ⇒ Object
OAuth client secret.
20 21 22 |
# File 'lib/iron_bank/configuration.rb', line 20 def client_secret @client_secret end |
#domain ⇒ Object
The Zuora domain for our tenant (apisandbox, production, etc.).
14 15 16 |
# File 'lib/iron_bank/configuration.rb', line 14 def domain @domain end |
#excluded_fields_file ⇒ Object
File path for excluded fields (when querying using ZOQL)
29 30 31 |
# File 'lib/iron_bank/configuration.rb', line 29 def excluded_fields_file @excluded_fields_file end |
#export_directory ⇒ Object
Directory where the local records are exported.
35 36 37 |
# File 'lib/iron_bank/configuration.rb', line 35 def export_directory @export_directory end |
#logger ⇒ Object
Logger
11 12 13 |
# File 'lib/iron_bank/configuration.rb', line 11 def logger @logger end |
#middlewares ⇒ Object
middlewares
8 9 10 |
# File 'lib/iron_bank/configuration.rb', line 8 def middlewares @middlewares end |
#schema_directory ⇒ Object
Directory where the XML describe files are located.
32 33 34 |
# File 'lib/iron_bank/configuration.rb', line 32 def schema_directory @schema_directory end |
#users_file ⇒ Object
File path for Zuora users export
38 39 40 |
# File 'lib/iron_bank/configuration.rb', line 38 def users_file @users_file end |
Instance Method Details
#credentials ⇒ Object
75 76 77 78 79 80 81 82 |
# File 'lib/iron_bank/configuration.rb', line 75 def credentials { domain: domain, client_id: client_id, client_secret: client_secret, auth_type: auth_type } end |
#credentials? ⇒ Boolean
84 85 86 |
# File 'lib/iron_bank/configuration.rb', line 84 def credentials? credentials.values.all? end |
#excluded_fields ⇒ Object
92 93 94 95 96 97 98 99 100 101 102 103 104 |
# File 'lib/iron_bank/configuration.rb', line 92 def excluded_fields return {} unless excluded_fields_file unless File.exist?(excluded_fields_file) IronBank.logger.warn "File does not exist: #{excluded_fields_file}" return {} end @excluded_fields ||= Psych.load_file(excluded_fields_file).tap do |fields| raise "Excluded fields must be a hash" unless fields.is_a?(Hash) end end |