mcoin 0.5.0 → 0.5.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/mcoin/subscriber.rb +4 -4
- data/lib/mcoin/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 19a3bd3a7e72530ae744f2791ba20c7a45862711
|
4
|
+
data.tar.gz: a7ec548ecb1e4626971d03d65525182399eb9f14
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59b8730253f0be1c32be90671bdf5f1bf0c052a8c411c07d23894d776083058e0718e2b16ea237442b3e065a5963eb10a6d67acac797831d7666a3a12b0d9030
|
7
|
+
data.tar.gz: be70247fcffd214db3beb8b2b9224ae16c6d0019eac07b63efdb13484b60f3561841dc1b061da4fe43368e4f5db6088b2575d7cfb0d1139509457b41be6f870a
|
data/lib/mcoin/subscriber.rb
CHANGED
@@ -4,14 +4,14 @@ module Mcoin
|
|
4
4
|
class Subscriber
|
5
5
|
attr_reader :markets, :pairs
|
6
6
|
|
7
|
-
def initialize(pairs = [],
|
7
|
+
def initialize(pairs = [], markets = Market.available)
|
8
8
|
@pairs = pairs_from(pairs)
|
9
|
-
@markets =
|
9
|
+
@markets = markets
|
10
10
|
end
|
11
11
|
|
12
12
|
def start(interval = 1, &block)
|
13
13
|
loop do
|
14
|
-
Parallel.async(markets, :fetch) do |result|
|
14
|
+
Parallel.async(markets_from(markets), :fetch) do |result|
|
15
15
|
yield result.to_ticker
|
16
16
|
end
|
17
17
|
sleep interval
|
@@ -27,7 +27,7 @@ module Mcoin
|
|
27
27
|
end
|
28
28
|
|
29
29
|
def markets_from(picked)
|
30
|
-
|
30
|
+
picked.map do |name|
|
31
31
|
pairs.map do |pair|
|
32
32
|
Market
|
33
33
|
.pick(name)
|
data/lib/mcoin/version.rb
CHANGED