hermod 1.2.6 → 1.2.7

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: e281315f76218c847f1a16a9a1828dcafc4e9447
4
- data.tar.gz: b35324a2d9c5b62459ff6e4340d5e47e58eeb011
3
+ metadata.gz: ef33832a31596201272eff93fafec732c8ce0ef8
4
+ data.tar.gz: 0c1041e047d5f1eeac03289020b4d96ff4ae5e6e
5
5
  SHA512:
6
- metadata.gz: c86cfb504e7721ef2da0dbb0b1894d19f791b9208c407d8fb9a7e0d3d1760b9f0ed15a5f2de4216d42554a5fdb733fde49c2c913051304e7e0f89515b1558b35
7
- data.tar.gz: 997794075ef8441ca110a13d21b1e57e1ba77cb003ab147ada1a8f7d6dfa547dcd58c1942e2f9b35f1adf7ff6f02f52b4dcfb291a4b27c57d5d1709f4ac21566
6
+ metadata.gz: a546ca2ac4d0240f7dc02b0f5c75c4dedb5ad6b17d73cae601673c85e9022555dfde662089203072d6aea5e1297bea79436002735ac8fbdbe4c46da4b1153f0e
7
+ data.tar.gz: 45d8b61b5ec6856fe4aa50db8c2501eea15a8d6e708b0facf2349c051374cfd66cd24f3671d937b768a34500ce2c5aec11a940014c5a663d0ac410f11d12ad71
@@ -1,3 +1,3 @@
1
1
  module Hermod
2
- VERSION = "1.2.6"
2
+ VERSION = "1.2.7"
3
3
  end
@@ -152,7 +152,7 @@ module Hermod
152
152
  end
153
153
 
154
154
  create_method(name, [], validators, options) do |value, attributes|
155
- value = value.to_i
155
+ value ||= value.to_i
156
156
  if options[:optional] && value == 0
157
157
  [nil, attributes]
158
158
  else
@@ -14,13 +14,13 @@ module Hermod
14
14
  describe "Monetary nodes" do
15
15
  subject do
16
16
  MonetaryXml.new do |dummy|
17
- dummy.pay 1000
17
+ dummy.pay 123.45
18
18
  dummy.tax 0
19
19
  end
20
20
  end
21
21
 
22
22
  it "should format values with the provided format string" do
23
- value_of_node("Pay").must_equal "1000.00"
23
+ value_of_node("Pay").must_equal "123.45"
24
24
  end
25
25
 
26
26
  it "should not include optional nodes if they're zero" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: hermod
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.6
4
+ version: 1.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Harry Mills
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-11-05 00:00:00.000000000 Z
11
+ date: 2014-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: libxml-ruby