medea 0.2.8 → 0.2.9

Sign up to get free protection for your applications and to get access to all the features.
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.2.8
1
+ 0.2.9
@@ -2,9 +2,9 @@ module Medea
2
2
  class JasonDeferredQuery
3
3
  require 'rest_client'
4
4
 
5
- attr_accessor :time_limit, :result_format, :type, :result_format, :time_limit, :state, :contents, :filters
5
+ attr_accessor :time_limit, :result_format, :type, :time_limit, :state, :contents, :filters
6
6
 
7
- def initialize a_class, format=:json
7
+ def initialize a_class, format=:search
8
8
  @type = a_class
9
9
  @filters = {:FILTER => {:HTTP_X_CLASS => a_class.name.to_s}, :VERSION0 => nil}
10
10
  @result_format = format
@@ -106,7 +106,7 @@ module Medea
106
106
  begin
107
107
  #puts " = Executing #{type.name} deferred query! (#{to_url})"
108
108
  result = JSON.parse(RestClient.get to_url)
109
-
109
+ self.contents = []
110
110
  #results are in a hash, their keys are just numbers
111
111
  result.keys.each do |k|
112
112
  if k =~ /^[0-9]+$/
@@ -114,6 +114,9 @@ module Medea
114
114
  /\/([^\/]*)\/([^\/]*)$/.match result[k]["POST_TO"]
115
115
  #$1 is the class name, $2 is the key
116
116
  item = type.new($2, :lazy)
117
+ if result[k].has_key? "CONTENT"
118
+ item.instance_variable_set(:__jason_data, result[k]["CONTENT"])
119
+ end
117
120
  self.contents << item
118
121
  end
119
122
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: medea
3
3
  version: !ruby/object:Gem::Version
4
- hash: 7
4
+ hash: 5
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 2
9
- - 8
10
- version: 0.2.8
9
+ - 9
10
+ version: 0.2.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Michael Jensen