rakuten 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md CHANGED
@@ -29,8 +29,8 @@ APIのバージョンやパラメーターについては、楽天WEB SERVICEの
29
29
 
30
30
  結果は、レスポンスJSONからハッシュの形で取得します.
31
31
 
32
- cnt = result['count']
33
- items = result['Items']['Item']
32
+ cnt = result['count'] # アイテム件数
33
+ items = result['Items']['Item'] # アイテム配列
34
34
 
35
35
  形式は呼び出したAPIによって様々です. 楽天WEB SERVICEの [ドキュメント](http://webservice.rakuten.co.jp/) の、各APIの解説にある出力パラメーターの欄を参照してください.
36
36
 
@@ -12,15 +12,15 @@ module Rakuten
12
12
  class Client
13
13
  attr_reader :raw_response
14
14
 
15
- def initialize(developer_id, affiliate_id = nil)
16
- @developer_id, @affiliate_id = developer_id, affiliate_id
15
+ def initialize(developer_id, affiliate_id = nil, http_opts = {})
16
+ @developer_id, @affiliate_id, @http_opts = developer_id, affiliate_id, http_opts
17
17
  end
18
18
 
19
19
  # リクエストを実行して結果を返す.
20
20
  # 結果はJSONをパーズしたHash.
21
21
  # リクエストに失敗したら例外をスローする.
22
22
  def request(operation, version = nil, params = {})
23
- response = open(request_url(operation, version, params)) do |f|
23
+ response = open(request_url(operation, version, params), @http_opts) do |f|
24
24
  @raw_response = f.read
25
25
  JSON.parse(@raw_response)
26
26
  end
@@ -1,3 +1,3 @@
1
1
  module Rakuten
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 0
9
- version: 0.1.0
8
+ - 1
9
+ version: 0.1.1
10
10
  platform: ruby
11
11
  authors:
12
12
  - Tomonori Kusanagi