Class: Zold::SyncWallets
- Inherits:
-
Object
- Object
- Zold::SyncWallets
- Defined in:
- lib/zold/sync_wallets.rb
Overview
Synchronized collection of wallets
Instance Method Summary collapse
- #all ⇒ Object
- #find(id) ⇒ Object
-
#initialize(wallets, timeout: 30, log: Log::Quiet.new) ⇒ SyncWallets
constructor
A new instance of SyncWallets.
- #path ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(wallets, timeout: 30, log: Log::Quiet.new) ⇒ SyncWallets
Returns a new instance of SyncWallets.
33 34 35 36 37 |
# File 'lib/zold/sync_wallets.rb', line 33 def initialize(wallets, timeout: 30, log: Log::Quiet.new) @wallets = wallets @log = log @timeout = timeout end |
Instance Method Details
#all ⇒ Object
47 48 49 |
# File 'lib/zold/sync_wallets.rb', line 47 def all @wallets.all end |
#find(id) ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/zold/sync_wallets.rb', line 51 def find(id) @wallets.find(id) do |wallet| Futex.new(wallet.path, log: @log).open do yield wallet end end end |
#path ⇒ Object
43 44 45 |
# File 'lib/zold/sync_wallets.rb', line 43 def path @wallets.path end |
#to_s ⇒ Object
39 40 41 |
# File 'lib/zold/sync_wallets.rb', line 39 def to_s @wallets.to_s end |