handcrafted-a2ws 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION.yml +1 -1
- data/a2ws.gemspec +1 -1
- data/lib/a2ws/item_search.rb +5 -5
- metadata +1 -1
data/VERSION.yml
CHANGED
data/a2ws.gemspec
CHANGED
data/lib/a2ws/item_search.rb
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
module A2WS
|
2
2
|
|
3
3
|
class ItemSearch < Base
|
4
|
-
attr_accessor :
|
4
|
+
attr_accessor :search_index
|
5
5
|
|
6
6
|
def initialize(search_index = :All)
|
7
7
|
@search_index = search_index
|
@@ -11,13 +11,13 @@ module A2WS
|
|
11
11
|
options.merge!({:Keywords => keywords, :SearchIndex => @search_index})
|
12
12
|
result = self.class.get('/onca/xml', :query => options)
|
13
13
|
|
14
|
-
|
15
|
-
if
|
16
|
-
|
14
|
+
items = result["ItemSearchResponse"]["Items"]
|
15
|
+
if items['Request']['IsValid'] == 'True'
|
16
|
+
items['Item'].collect do |i|
|
17
17
|
Item.new downcase_keys(i)
|
18
18
|
end
|
19
19
|
else
|
20
|
-
raise
|
20
|
+
raise items['Request']['Errors']['Error']['Message']
|
21
21
|
end
|
22
22
|
end
|
23
23
|
|