bovespa-prices 1.0.1 → 1.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bovespa-prices.rb +2 -2
- data/spec/bovespa-prices_spec.rb +2 -7
- metadata +1 -1
data/lib/bovespa-prices.rb
CHANGED
@@ -2,7 +2,7 @@ require 'httpclient'
|
|
2
2
|
require 'nokogiri'
|
3
3
|
|
4
4
|
class Bovespa
|
5
|
-
VERSION = "1.0.
|
5
|
+
VERSION = "1.0.2"
|
6
6
|
|
7
7
|
class Stock
|
8
8
|
attr_accessor :code, :name, :date, :opening_price, :min_price, :max_price, :average_price, :last_price, :variation
|
@@ -31,6 +31,6 @@ class Bovespa
|
|
31
31
|
result[st.code.to_sym] = st
|
32
32
|
end
|
33
33
|
|
34
|
-
result
|
34
|
+
return (stock_codes.size > 1 ? result : result[stock_codes.first])
|
35
35
|
end
|
36
36
|
end
|
data/spec/bovespa-prices_spec.rb
CHANGED
@@ -80,13 +80,8 @@ describe Bovespa::Stock do
|
|
80
80
|
|
81
81
|
result = Bovespa.new.get(:VALE5)
|
82
82
|
|
83
|
-
result.
|
84
|
-
result.should
|
85
|
-
result.size.should == 1
|
86
|
-
result.should have_key :VALE5
|
87
|
-
|
88
|
-
result[:VALE5].should be_a_kind_of Bovespa::Stock
|
89
|
-
result[:VALE5].to_s.should == "VALE5 - 'VALE PNA N1' 32.88 32.54 33.24 32.61 33.04 2.25"
|
83
|
+
result.should be_a_kind_of Bovespa::Stock
|
84
|
+
result.to_s.should == "VALE5 - 'VALE PNA N1' 32.88 32.54 33.24 32.61 33.04 2.25"
|
90
85
|
end
|
91
86
|
|
92
87
|
it "should parse a xml with two stocks from bovespa to one Stock" do
|