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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 0e0315ba814b65cfc27b1d1fabe2be64eba8c66c
4
- data.tar.gz: b94b807edac4e43126ad4db54443fd56ae5ab583
3
+ metadata.gz: 3b97e81662cbbfe3166ae9eae30417ee4289a18e
4
+ data.tar.gz: 71056fd34920000ed4b59ef7c7c76105988e27f4
5
5
  SHA512:
6
- metadata.gz: 492074f1e2d41e73c6b0b0fb7c10c5cef7dad73c0c6e0b05cfd3ac5e64d4e284ea18e4030c87ab6d7aaebb65bfc0d59c2ac520ffd5d0a5c914d6b5e8f752d04a
7
- data.tar.gz: da89bb54b5b05c6fd7990cb7e310c31a53b83eb6032a4775fb94932cc8a6fe4c641a1021c9adfb3f2ccaf640e8f82205d84ddcba742d70870adeb9707de7a8b9
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].set_fields data
58
- yield stocks[index] if block_given?
57
+ stock = stocks[index]
58
+ stock.set_fields data
59
+ yield stock if block_given?
59
60
  end
60
61
  end
61
62
  stocks
@@ -1,4 +1,4 @@
1
1
  # =>CStock::VERSION
2
2
  module CStock
3
- VERSION = '0.4.2'
3
+ VERSION = '0.4.3'
4
4
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cstock
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.4.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Aston Fu