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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e6d08265845c5ecc6dcfda46dd66776e0d23c489
4
- data.tar.gz: 242e0b821fd361a46d38a864d654b1f4324446e6
3
+ metadata.gz: 39d686a14bc85492ab2c14febba48aa87f4f6886
4
+ data.tar.gz: ac9700fdf9aaeebf0c33dcf7a9afb6af044942b0
5
5
  SHA512:
6
- metadata.gz: c8cea6a257f708fcd7d6a89f51c2487c06420a2c4d807a9920962a24774d260e4ac5f1538011e2ca19845c2f66c92955f75e924364783595f004a3f3126af56d
7
- data.tar.gz: 549b9daeb15309b922fe9240ec3a54c319ea2e52e8cd8691c706ef85b2fc36819ed1e94571cc06fedc9fc925ccd75d0af9a4a6b688d8c7adc2196fc35f7db09c
6
+ metadata.gz: d58ea3703ec35453f365641d47537d6d2ceba5637453d7f54355d2985fc29a14d7609690ca833937fde57a96c1a7dc335d62d563efbd4166281fd1e1d207081a
7
+ data.tar.gz: e154eeeaac55e95cb6ea58c51003fa01144b6e4780af092fa231acfea99cf9d2b4ce98f1620be79c641456169f22b1f8d3748c51aa636c5fa577dba681e67e59
@@ -8,8 +8,8 @@ module XmlResource
8
8
  self.objects = {}
9
9
  self.inflection = :underscore
10
10
 
11
- class XmlResource::ParseError < Exception; end
12
- class XmlResource::TypeCastError < Exception; end
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.nil? ? default_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
@@ -1,3 +1,3 @@
1
1
  module XmlResource
2
- VERSION = '2.0.4'
2
+ VERSION = '2.0.5'
3
3
  end
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
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-19 00:00:00.000000000 Z
11
+ date: 2013-11-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activesupport