Class: KPM::TenantConfig
- Inherits:
-
Object
- Object
- KPM::TenantConfig
- Defined in:
- lib/kpm/tenant_config.rb
Constant Summary collapse
- KILLBILL_HOST =
Killbill server
ENV['KILLBILL_HOST'] || '127.0.0.1'
- KILLBILL_URL =
'http://'.concat(KILLBILL_HOST).concat(':8080')
- KILLBILL_API_VERSION =
'1.0'- KILLBILL_USER =
USER/PWD
ENV['KILLBILL_USER'] || 'admin'
- KILLBILL_PASSWORD =
ENV['KILLBILL_PASSWORD'] || 'password'
- KILLBILL_API_KEY =
TENANT KEY
ENV['KILLBILL_API_KEY'] || 'bob'
- KILLBILL_API_SECRET =
ENV['KILLBILL_API_SECRET'] || 'lazar'
- TMP_DIR_PEFIX =
Temporary directory
'killbill'- TMP_DIR =
Dir.mktmpdir(TMP_DIR_PEFIX)
- KEY_PREFIXES =
Tenant key prefixes
['PLUGIN_CONFIG','PUSH_NOTIFICATION_CB','PER_TENANT_CONFIG', 'PLUGIN_PAYMENT_STATE_MACHINE','CATALOG','OVERDUE_CONFIG', 'INVOICE_TRANSLATION','CATALOG_TRANSLATION','INVOICE_TEMPLATE','INVOICE_MP_TEMPLATE']
Instance Method Summary collapse
- #export(key_prefix = nil) ⇒ Object
-
#initialize(killbill_api_credentials = nil, killbill_credentials = nil, killbill_url = nil, logger = nil) ⇒ TenantConfig
constructor
A new instance of TenantConfig.
Constructor Details
#initialize(killbill_api_credentials = nil, killbill_credentials = nil, killbill_url = nil, logger = nil) ⇒ TenantConfig
Returns a new instance of TenantConfig.
31 32 33 34 35 36 37 38 39 40 41 |
# File 'lib/kpm/tenant_config.rb', line 31 def initialize(killbill_api_credentials = nil, killbill_credentials = nil, killbill_url = nil, logger = nil) @killbill_api_key = KILLBILL_API_KEY @killbill_api_secrets = KILLBILL_API_SECRET @killbill_url = KILLBILL_URL @killbill_user = KILLBILL_USER @killbill_password = KILLBILL_PASSWORD @logger = logger (killbill_api_credentials,killbill_credentials,killbill_url) end |
Instance Method Details
#export(key_prefix = nil) ⇒ Object
43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 |
# File 'lib/kpm/tenant_config.rb', line 43 def export(key_prefix = nil) export_data = fetch_export_data(key_prefix) if export_data.size == 0 raise Interrupt, 'key_prefix not found' end export_file = store_into_file(export_data) if not File.exist?(export_file) raise Interrupt, 'key_prefix not found' else @logger.info "\e[32mData exported under #{export_file}\e[0m" end export_file end |