Class: RefreshWalletWorker
- Inherits:
-
Object
- Object
- RefreshWalletWorker
- Includes:
- SuckerPunch::Job
- Defined in:
- lib/eme/billing/workers/refresh_wallet_worker.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.all_connections ⇒ Object
14 15 16 |
# File 'lib/eme/billing/workers/refresh_wallet_worker.rb', line 14 def self.all_connections @available_connections end |
.get_connection ⇒ Object
6 7 8 |
# File 'lib/eme/billing/workers/refresh_wallet_worker.rb', line 6 def self.get_connection @available_connections.pop end |
.return_connection(conn) ⇒ Object
10 11 12 |
# File 'lib/eme/billing/workers/refresh_wallet_worker.rb', line 10 def self.return_connection(conn) @available_connections.push(conn) end |
Instance Method Details
#perform(master_account_id, currency = "EMP", opts = {}) ⇒ Object
18 19 20 21 22 |
# File 'lib/eme/billing/workers/refresh_wallet_worker.rb', line 18 def perform(master_account_id, currency = "EMP", opts = {}) conn = RefreshWalletWorker.get_connection EME::Billing.reload_wallet(master_account_id, currency, opts, EME::Billing.connection(conn)) RefreshWalletWorker.return_connection(conn) end |