endeca_on_demand 0.9.6 → 0.9.7

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.
@@ -1,3 +1,3 @@
1
1
  class EndecaOnDemand
2
- VERSION = "0.9.6"
2
+ VERSION = "0.9.7"
3
3
  end
@@ -38,11 +38,17 @@ class EndecaOnDemand
38
38
 
39
39
  ## DEBUG
40
40
  attr_reader :uri, :http
41
- attr_reader :base, :query, :request, :raw_response, :response
41
+ attr_reader :base, :query, :request, :raw_response, :response, :error
42
42
  ## /DEBUG
43
43
 
44
44
  ### /API
45
45
 
46
+ def method_missing(method, *args, &block)
47
+ unless self.instance_variables.include?(:"@#{method}")
48
+ puts "Unable to retrieve this value because: #{@error.message}"
49
+ end
50
+ end
51
+
46
52
  private
47
53
 
48
54
  ### XML REQUEST ###
@@ -157,7 +163,7 @@ class EndecaOnDemand
157
163
  @request, @raw_response = @http.post(@uri.path, @query.target!, 'Content-type' => 'application/xml')
158
164
  handle_response(Crackoid::XML.parse(@raw_response))
159
165
  rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, Errno::ECONNREFUSED, EOFError, Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => error
160
- puts "ERROR: #{error.message}"
166
+ @error = error
161
167
  end
162
168
  end
163
169
 
@@ -254,7 +260,7 @@ class EndecaOnDemand
254
260
  breads = @response['Breadcrumbs']['Breads']
255
261
  if breads.instance_of?(Hash)
256
262
  breads.each do |key, value|
257
- @filtercrumbs.push(value)
263
+ @filtercrumbs.push(EndecaOnDemand::Crumb.new(value))
258
264
  end
259
265
  elsif breads.instance_of?(Array)
260
266
  breads.each do |bread|
@@ -262,7 +268,7 @@ class EndecaOnDemand
262
268
  @filtercrumbs.push(bread['Bread'])
263
269
  elsif bread.instance_of?(Array)
264
270
  bread['Bread'].each do |crumb|
265
- @filtercrumbs.push(crumb)
271
+ @filtercrumbs.push(EndecaOnDemand::Crumb.new(crumb))
266
272
  end
267
273
  end
268
274
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: endeca_on_demand
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.9.6
5
+ version: 0.9.7
6
6
  platform: ruby
7
7
  authors:
8
8
  - sdomino
@@ -10,7 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-08-11 00:00:00 Z
13
+ date: 2011-08-18 00:00:00 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: crackoid