caren-api 0.5.14 → 0.5.15
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/caren-api.gemspec +1 -1
- data/lib/caren/base.rb +5 -4
- data/lib/caren/caren.rb +2 -2
- metadata +3 -3
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.15
|
data/caren-api.gemspec
CHANGED
data/lib/caren/base.rb
CHANGED
@@ -3,10 +3,11 @@
|
|
3
3
|
# on the default Caren API format.
|
4
4
|
class Caren::Base
|
5
5
|
|
6
|
-
attr_accessor :attributes
|
6
|
+
attr_accessor :attributes, :original_xml
|
7
7
|
|
8
8
|
# Basic initializer, handles quick setting of passed attributes.
|
9
|
-
def initialize args={}
|
9
|
+
def initialize args={}, xml=""
|
10
|
+
self.original_xml = xml
|
10
11
|
self.attributes = {}
|
11
12
|
self.class.keys.each do |key|
|
12
13
|
if args.has_key?(key)
|
@@ -65,9 +66,9 @@ class Caren::Base
|
|
65
66
|
if hash.has_key?(self.array_root.to_s)
|
66
67
|
return hash[self.array_root.to_s].map{ |h| init_dependent_objects(self.from_xml(h)) }
|
67
68
|
elsif hash.has_key?(self.node_root.to_s)
|
68
|
-
return init_dependent_objects(self.new( hash[self.node_root.to_s] ))
|
69
|
+
return init_dependent_objects(self.new( hash[self.node_root.to_s], xml ))
|
69
70
|
else
|
70
|
-
return init_dependent_objects(self.new( hash ))
|
71
|
+
return init_dependent_objects(self.new( hash, xml ))
|
71
72
|
end
|
72
73
|
end
|
73
74
|
|
data/lib/caren/caren.rb
CHANGED
@@ -152,7 +152,7 @@ module Caren
|
|
152
152
|
hash = hash["caren_objects"]
|
153
153
|
end
|
154
154
|
Caren::Api.supported_incoming_objects.each do |key,klass|
|
155
|
-
objects << (hash[key]||hash[key.to_s]||[]).map{ |h| klass.init_dependent_objects(klass.new(h)) }
|
155
|
+
objects << (hash[key]||hash[key.to_s]||[]).map{ |h| klass.init_dependent_objects(klass.new(h,xml)) }
|
156
156
|
end
|
157
157
|
return objects.flatten
|
158
158
|
end
|
@@ -163,7 +163,7 @@ module Caren
|
|
163
163
|
Caren::Api.supported_incoming_single_objects.each do |key, klass|
|
164
164
|
object = hash[key] || hash[key.to_s]
|
165
165
|
if object
|
166
|
-
return klass.init_dependent_objects(klass.new(object))
|
166
|
+
return klass.init_dependent_objects(klass.new(object,xml))
|
167
167
|
end
|
168
168
|
end
|
169
169
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: caren-api
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 21
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 5
|
9
|
-
-
|
10
|
-
version: 0.5.
|
9
|
+
- 15
|
10
|
+
version: 0.5.15
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Andre Foeken
|