cxml-ruby 0.4.0 → 0.4.1

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
  SHA256:
3
- metadata.gz: ca2ed654a5b8543d2beb69ec7acb0db49b2f1fbd7210ef1d4928b4da4fa0cb96
4
- data.tar.gz: 90b66c83fe8ea876050daad559ecd0b3349d578ab1ea21e0ef79e234c0382e44
3
+ metadata.gz: 38b4bf64619173383fb1d6bbb76d1877bc70746752d884b6f9d79f967fcb70c0
4
+ data.tar.gz: 2f42907da9ebe23561a44f0a39ac1143e32660b465c5b19cea13dbbcd1328ee4
5
5
  SHA512:
6
- metadata.gz: 12d39fe0bd266b4308853a8bd2a331cc546e0ca43643629dbe264ea3f44cdaeb5d55ac7590e42e1297b7dcd957d1f91daba4af96b19e96b0d92548f47f51f307
7
- data.tar.gz: 1c9ab1f5f5c03555e9ac12ceedd41afa016a25c38cde5e2eea01ee9792953fb1aad10bc3b47254729daf5563b178534b0c6bd5da2ae65e17bff334f28f4510b5
6
+ metadata.gz: 18ab3bad5fb8231724c14e29eb19c71ed1abdca1c9efd45832de27d46125070a705790a7813926f2f21273fdc010238de30d2405a251bcc28af389f5e075db76
7
+ data.tar.gz: 5b3206398d10770f12215be79a4f6877db2d6efafc9679e31cc08a756384247466c90cd061b3f044befbfc39e631f35cb0029f83792dce69220e9ca75e05347d
data/CHANGELOG.md CHANGED
@@ -14,6 +14,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
14
14
 
15
15
  ---
16
16
 
17
+ ## [0.4.1] - 2020-04-20
18
+ ### Changed
19
+ - Cast all node content values to strings before passing to Ox serializer.
20
+
17
21
  ## [0.4.0] - 2020-04-20
18
22
  ### Changed
19
23
  - Return parsed nodes as plain string if they have no attributes and only string content.
@@ -54,7 +54,7 @@ module CXML
54
54
 
55
55
  def to_element
56
56
  element = ox_element
57
- element << content if content
57
+ element << content.to_s if content
58
58
  self.class.nodes.each do |child_node_name|
59
59
  child_value = send(child_node_name)
60
60
  if child_value.is_a?(Array)
@@ -88,12 +88,12 @@ module CXML
88
88
  value_element = Ox::Element.new(camelize(name))
89
89
  if value.is_a? Hash
90
90
  value.each do |value_key, value_val|
91
- next value_element << value_val if value_key == :content
91
+ next value_element << value_val.to_s if value_key == :content
92
92
 
93
93
  value_element[value_key] = value_val
94
94
  end
95
95
  else
96
- value_element << value
96
+ value_element << value.to_s
97
97
  end
98
98
  element << value_element
99
99
  element
data/lib/cxml/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module CXML
4
- VERSION = '0.4.0'
4
+ VERSION = '0.4.1'
5
5
  end
data/spec/money_spec.rb CHANGED
@@ -38,5 +38,13 @@ describe CXML::Money do
38
38
  it 'contains the required nodes' do
39
39
  money_output_data[:currency].should_not be_empty
40
40
  end
41
+
42
+ it 'can render non-string values' do
43
+ CXML::Document.new(message: { punch_out_order_message: {
44
+ punch_out_order_message_header: {
45
+ total: { money: { content: 12.3 } },
46
+ },
47
+ } }).to_xml
48
+ end
41
49
  end
42
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cxml-ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Beckman