xommelier 0.1.10 → 0.1.11

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,3 +1,3 @@
1
1
  module Xommelier
2
- VERSION = '0.1.10'
2
+ VERSION = '0.1.11'
3
3
  end
@@ -60,7 +60,8 @@ module Xommelier
60
60
 
61
61
  def to_xml(options = {})
62
62
  options = SERIALIZATION_OPTIONS.merge(options)
63
- element_name = options.delete(:element_name) { self.element_name }.to_s
63
+ element_name = options.delete(:element_name) { self.element_name }
64
+ element_name = element_name.to_s
64
65
  element_name << '_' if %w(text class id).include?(element_name)
65
66
  if options[:builder] # Non-root element
66
67
  builder = options.delete(:builder)
@@ -196,7 +197,9 @@ module Xommelier
196
197
  when Xommelier::Xml::Element
197
198
  value.to_xommelier(builder: xml, element_name: options[:element_name])
198
199
  else
199
- (prefix ? xml[prefix] : xml).send(options[:element_name]) { xml.text value.to_xommelier }
200
+ element_name = options[:element_name].to_s
201
+ element_name << '_' if %w(text class id).include?(element_name)
202
+ (prefix ? xml[prefix] : xml).send(element_name) { xml.text(value.to_xommelier) }
200
203
  end
201
204
  end
202
205
  end
@@ -1,5 +1,5 @@
1
1
  require 'spec_helper'
2
2
 
3
3
  describe Xommelier do
4
- it { Xommelier::VERSION.should == '0.1.10' }
4
+ it { Xommelier::VERSION.should == '0.1.11' }
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: xommelier
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: