xml_resource 2.0.4 → 2.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/xml_resource/base.rb +5 -5
- data/lib/xml_resource/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 39d686a14bc85492ab2c14febba48aa87f4f6886
|
4
|
+
data.tar.gz: ac9700fdf9aaeebf0c33dcf7a9afb6af044942b0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d58ea3703ec35453f365641d47537d6d2ceba5637453d7f54355d2985fc29a14d7609690ca833937fde57a96c1a7dc335d62d563efbd4166281fd1e1d207081a
|
7
|
+
data.tar.gz: e154eeeaac55e95cb6ea58c51003fa01144b6e4780af092fa231acfea99cf9d2b4ce98f1620be79c641456169f22b1f8d3748c51aa636c5fa577dba681e67e59
|
data/lib/xml_resource/base.rb
CHANGED
@@ -8,8 +8,8 @@ module XmlResource
|
|
8
8
|
self.objects = {}
|
9
9
|
self.inflection = :underscore
|
10
10
|
|
11
|
-
class XmlResource::ParseError <
|
12
|
-
class XmlResource::TypeCastError <
|
11
|
+
class XmlResource::ParseError < StandardError; end
|
12
|
+
class XmlResource::TypeCastError < StandardError; end
|
13
13
|
|
14
14
|
class << self
|
15
15
|
|
@@ -23,7 +23,7 @@ module XmlResource
|
|
23
23
|
if !value.nil? && type = attribute_type(name)
|
24
24
|
value = cast_to(type, value)
|
25
25
|
end
|
26
|
-
attrs[name] = value
|
26
|
+
attrs[name] = value
|
27
27
|
end
|
28
28
|
end
|
29
29
|
self.objects.each do |name, options|
|
@@ -36,7 +36,7 @@ module XmlResource
|
|
36
36
|
attrs[name] = collection_class(name).collection_from_xml(xml.at(xpath))
|
37
37
|
end
|
38
38
|
end
|
39
|
-
new attrs
|
39
|
+
new attrs.reject { |k, v| v.nil? }.reverse_merge(default_attrs)
|
40
40
|
end
|
41
41
|
|
42
42
|
def collection_from_xml(xml_or_string, default_attrs = {})
|
@@ -198,4 +198,4 @@ module XmlResource
|
|
198
198
|
end
|
199
199
|
|
200
200
|
end
|
201
|
-
end
|
201
|
+
end
|
data/lib/xml_resource/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xml_resource
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0.
|
4
|
+
version: 2.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Matthias Grosser
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-11-
|
11
|
+
date: 2013-11-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|