xml_hate 2.0.0 → 2.1.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9e77b6e96c739ee1560ebeb9158231ca4dc3fc75
4
- data.tar.gz: 0fd62016eaaf3fbde01b39e64ef67f1c3c42d6c1
3
+ metadata.gz: 8c538c88b31a61fe85d671c90327edcd354789a4
4
+ data.tar.gz: ee0540a3fe14842b29d1219c02e5c8a9e306f086
5
5
  SHA512:
6
- metadata.gz: 65a5153b5b0fa43018b8ba42d773f476fd9477da4a5de900cd851f5da7dcd6cdb18096f90989709b96e8dbbb78e64a2b56da1e60db222c56f5ff21298b3db48e
7
- data.tar.gz: c3b96a173c076287c4975451b36b0b1cdb94ccb18981c8809a60d336e6863dfa5d00f1db96166c1e241f96b638dcbc3d170649d4eaa8ebd48bda7b880e25ea32
6
+ metadata.gz: 593aa826eb3da1589217899839e8584b2acfb9081338f5549dc36e9532a7055a218232c43f0b3563929d7eea5c233f6fd54ea72eeceb0d4ef495c6bcc6f5f83a
7
+ data.tar.gz: 471c75e1a9153bf8b7dc19dbb8edebf101acb3e5e7ec3018c7120e1484e2977a2e26396f43349d0d4c5ebfc872b3f53b5d8907396f447d845a169d57e349e7e8
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- xml_hate (2.0.0)
4
+ xml_hate (2.1.0)
5
5
  activesupport
6
6
  hashie
7
7
  xml-simple
data/lib/xml_hate/node.rb CHANGED
@@ -23,6 +23,10 @@ module XmlHate
23
23
  an_empty_array_for_plurals_or_empty_string_for_singulars meth
24
24
  end
25
25
 
26
+ def to_hash
27
+ @_keys.reduce({}) { |t, i| t.merge(i => self.send(i) ) }
28
+ end
29
+
26
30
  private
27
31
 
28
32
  def all_items_in_the_hash_that_are_not_nil(the_hash)
@@ -1,3 +1,3 @@
1
1
  module XmlHate
2
- VERSION = "2.0.0"
2
+ VERSION = "2.1.0"
3
3
  end
@@ -37,6 +37,12 @@ describe XmlHate::Node do
37
37
  @object.cats.must_equal []
38
38
  @object.dogs.must_equal []
39
39
  end
40
+
41
+ describe "to_hash" do
42
+ it "should return the node as a hash" do
43
+ @object.to_hash.must_equal( { firstname: 'John', lastname: 'Carter' } )
44
+ end
45
+ end
40
46
  end
41
47
 
42
48
  describe "creating a node with a child Hashie::Match" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xml_hate
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.0
4
+ version: 2.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Darren Cauthon
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-23 00:00:00.000000000 Z
11
+ date: 2015-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xml-simple