cstock 0.4.2 → 0.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cstock/stock.rb +4 -3
- data/lib/cstock/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: 3b97e81662cbbfe3166ae9eae30417ee4289a18e
|
4
|
+
data.tar.gz: 71056fd34920000ed4b59ef7c7c76105988e27f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a78156204b08c97f1fdcf6734a2a9db8dba4f37383dcdbe6fcba613bca542fcda8b46831572af708a62375ccb9772f7e38baa5aff54249b1bddeaa8e85a4a2ab
|
7
|
+
data.tar.gz: 588f4bd31a48b974265b819c9388bcdf7ed2d3212b5a30b6fc506e42618f70f78cb1c225028a4bab838e0ce77e8c86ce5f66db4831bde5d0fb8d4b40ca8fc539
|
data/lib/cstock/stock.rb
CHANGED
@@ -42,7 +42,7 @@ module CStock
|
|
42
42
|
# with the given data to set the stock field values except the fires filed -- code.
|
43
43
|
def set_fields(data)
|
44
44
|
FIELDS[1..-1].each_with_index do |field, index|
|
45
|
-
send("#{field}=".to_sym, (data[index].nil? ? nil : data[index]))
|
45
|
+
self.send("#{field}=".to_sym, (data[index].nil? ? nil : data[index]))
|
46
46
|
end
|
47
47
|
end
|
48
48
|
|
@@ -54,8 +54,9 @@ module CStock
|
|
54
54
|
# one quote return muti stocks data. So it saves time.
|
55
55
|
quote(stock_codes) do |datas|
|
56
56
|
datas.each_with_index do |data, index|
|
57
|
-
stocks[index]
|
58
|
-
|
57
|
+
stock = stocks[index]
|
58
|
+
stock.set_fields data
|
59
|
+
yield stock if block_given?
|
59
60
|
end
|
60
61
|
end
|
61
62
|
stocks
|
data/lib/cstock/version.rb
CHANGED