reuters 0.8.3 → 0.8.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OWYxOTIzMjQwYTc3YTA5MDk1NzJmZWM0YThkMjUyMTIzMWJlMGU5MA==
4
+ Zjk0NzBkNTExZjE2MjgzNDY4NzBhN2UxODdlN2VjNmY4NTk2YjIxMg==
5
5
  data.tar.gz: !binary |-
6
- MzNkZDVjZTlmNjA4ZGU4OGVhMDg1OWY1MDZlZDRiZGZkYzBkNGE2Zg==
6
+ MDVlM2NmZGEwOWU3ZDE5OTg0MjRlNWQ4MDNjZmIzODlkY2RiZTU5OQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZTE5NzQzZDY1YWEyM2MxYmM5OTY2MjQyN2JmYjc3N2FlNzAwNWZmNTY2MTY0
10
- MGJjMjhlMmY3MWQ4MDI2ZjQyMzI0YTRlYjhiM2IzYTc3NGUzYjY4MjFiMWUy
11
- MDk4NjM3YzE4ZjczYjA2YWU2NWZkN2I0NTA2OTM1MWQxNjMwY2E=
9
+ ZTMxMTg2ZDEwMDNlNjgzMWM3YTY1ZWUyYzJhMGM4NzY1MTNiOTBmNGU5ZGI1
10
+ MjAyNGFjMDA3YzdmNzRiNjg0OTMxNWQzYjAxMzI2OGQxMDJmNjM3M2Q2N2Qz
11
+ MTI0ODQ2NTA0MmI4OTE5N2M4ZWFjZGNhYzcyN2E2Mjg1MzBjYzM=
12
12
  data.tar.gz: !binary |-
13
- NDQwYjU0Zjg5YzZhNDFjNmM3MTg3ZWE4ODUyODllNTk3NGZhODBmMTY5NjNi
14
- YmM1ZjYwYzlhMjliYWIwYmRhMTRmYTY3Y2EwN2IwMTFiYTRlZTQxNDYyYjcx
15
- NTViYzhkZTg4NDNmYWEzNGJlNTZlZWU3OGU2NzEwNzk4N2FhNTA=
13
+ MDE0YjFhNGQ4NWRlY2EwYzQ3ZGZkNzlkM2FjNmM0OTA2YmVjMzRkNzE1NWE0
14
+ MTMzYmMyNmJiMTdlOTRjZTI2N2Y5YzU1ODI4YjhmNTc2NDJhNjRjM2NlOGRi
15
+ N2EzN2MzMTJiYWUwMGE0MmNjM2U0NTk1OGQwMWRlMWRhODQ0OTE=
data/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Thomson Reuters API Client
2
2
 
3
- [![Coverage Status](https://coveralls.io/repos/Stockflare/reuters/badge.png?branch=master)](https://coveralls.io/r/Stockflare/reuters?branch=master) [![Build Status](https://travis-ci.org/Stockflare/reuters.svg?branch=master)](https://travis-ci.org/Stockflare/reuters) [![Dependency Status](https://gemnasium.com/Stockflare/reuters.svg)](https://gemnasium.com/Stockflare/reuters) [![Code Climate](https://codeclimate.com/github/Stockflare/reuters.png)](https://codeclimate.com/github/Stockflare/reuters)
3
+ [![Coverage Status](https://coveralls.io/repos/Stockflare/reuters/badge.png?branch=master)](https://coveralls.io/r/Stockflare/reuters?branch=master) [![Build Status](https://travis-ci.org/Stockflare/reuters.svg?branch=master)](https://travis-ci.org/Stockflare/reuters) [![Dependency Status](https://gemnasium.com/Stockflare/reuters.svg)](https://gemnasium.com/Stockflare/reuters) [![Code Climate](https://codeclimate.com/github/Stockflare/reuters.png)](https://codeclimate.com/github/Stockflare/reuters) [![Gem Version](https://badge.fury.io/rb/reuters.png)](http://badge.fury.io/rb/reuters)
4
4
 
5
5
 
6
6
  Uses the [Reuter's TRKD API](http://thomsonreuters.com/knowledge-direct/) to grab financial data for stocks, such as quotes, estimates and snapshots.
@@ -202,8 +202,8 @@ Different Response classes parse data slightly differently depending on how it i
202
202
 
203
203
  ## Contributing
204
204
 
205
- The Reuters API is vast and has lots of calls that each vary in complexity and usage. At the moment, we only have limited development time, so have only developed the calls that we use.
205
+ The Reuters API is vast and has lots of calls that each vary in complexity and usage. At the moment, we only have limited development time, so have only developed the calls that we use.
206
206
 
207
- If you would like to develop an API Call, open an issue and please feel free to ask for assistance with building it.
207
+ If you would like to develop an API Call, open an issue and please feel free to ask for assistance with building it.
208
208
 
209
209
  If you find a bug, have a feature request or even want to contribute an enhancement or fix, please follow the contributing guidelines included in the repository.
@@ -1,7 +1,7 @@
1
1
  module Reuters
2
2
  # This class parses Savon response bodies into more practical
3
3
  # accessible objects, by using a recursive strategy for parsing
4
- # the content.
4
+ # the content.
5
5
  #
6
6
  # @note All attributes for XML elements can be accessed via the
7
7
  # attributes accessor.
@@ -20,8 +20,13 @@ module Reuters
20
20
 
21
21
  def method_missing(name)
22
22
  if key?(name)
23
- if (val = self[name]).is_a? String
24
- val
23
+ val = self[name]
24
+ case val
25
+ when String then val
26
+ when Array
27
+ val.collect do |v|
28
+ self.class.new v
29
+ end
25
30
  else
26
31
  self.class.new val
27
32
  end
@@ -29,4 +34,4 @@ module Reuters
29
34
  end
30
35
 
31
36
  end
32
- end
37
+ end
@@ -2,5 +2,5 @@
2
2
  # Knowledge Direct API.
3
3
  module Reuters
4
4
  # Current version of the Reuters gem.
5
- VERSION = '0.8.3'
5
+ VERSION = '0.8.5'
6
6
  end
@@ -9,13 +9,17 @@ describe Reuters::Response do
9
9
  name: {
10
10
  full_name: "ABC Solutions Ltd.",
11
11
  short_name: "ABC Ltd."
12
- }
12
+ },
13
+ list: [
14
+ { fruit: "apple" },
15
+ { fruit: "banana" }
16
+ ]
13
17
  },
14
18
  :@type => "ORD"
15
19
  }
16
20
  }
17
21
 
18
- before do
22
+ before do
19
23
  @response = Reuters::Response.new(test_hash)
20
24
  end
21
25
 
@@ -23,6 +27,22 @@ describe Reuters::Response do
23
27
 
24
28
  it { should respond_to(:attributes) }
25
29
 
30
+ describe "when a value is an array" do
31
+
32
+ it "should return an array" do
33
+ expect(@response.info.list).to be_a Array
34
+ end
35
+
36
+ it "should contain an array of Response objects" do
37
+ expect(@response.info.list.first).to be_an_instance_of Reuters::Response
38
+ end
39
+
40
+ it "should access nested array response objects" do
41
+ expect(@response.info.list.first.fruit).to eq "apple"
42
+ end
43
+
44
+ end
45
+
26
46
  describe "a nested response object" do
27
47
 
28
48
  it "should return a nested response object" do
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: reuters
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.3
4
+ version: 0.8.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stockflare