roxml 3.3.1 → 4.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (55) hide show
  1. checksums.yaml +7 -0
  2. data/.travis.yml +14 -0
  3. data/Gemfile +10 -6
  4. data/Gemfile.lock +102 -40
  5. data/History.txt +9 -0
  6. data/README.rdoc +3 -2
  7. data/Rakefile +6 -9
  8. data/VERSION +1 -1
  9. data/examples/search_query.rb +17 -0
  10. data/lib/roxml/definition.rb +4 -9
  11. data/lib/roxml/xml/references.rb +24 -9
  12. data/lib/roxml.rb +28 -13
  13. data/roxml.gemspec +42 -39
  14. data/spec/definition_spec.rb +85 -104
  15. data/spec/examples/active_record_spec.rb +13 -13
  16. data/spec/examples/amazon_spec.rb +13 -13
  17. data/spec/examples/current_weather_spec.rb +6 -6
  18. data/spec/examples/dashed_elements_spec.rb +3 -3
  19. data/spec/examples/library_spec.rb +3 -3
  20. data/spec/examples/library_with_fines_spec.rb +7 -7
  21. data/spec/examples/person_spec.rb +3 -3
  22. data/spec/examples/post_spec.rb +4 -4
  23. data/spec/examples/search_query_spec.rb +26 -0
  24. data/spec/examples/twitter_spec.rb +4 -4
  25. data/spec/reference_spec.rb +2 -2
  26. data/spec/regression_spec.rb +13 -8
  27. data/spec/roxml_spec.rb +30 -43
  28. data/spec/shared_specs.rb +2 -2
  29. data/spec/spec_helper.rb +2 -0
  30. data/spec/xml/array_spec.rb +2 -2
  31. data/spec/xml/attributes_spec.rb +7 -7
  32. data/spec/xml/encoding_spec.rb +9 -9
  33. data/spec/xml/namespace_spec.rb +40 -21
  34. data/spec/xml/namespaces_spec.rb +3 -3
  35. data/spec/xml/object_spec.rb +7 -7
  36. data/spec/xml/parser_spec.rb +2 -2
  37. data/spec/xml/text_spec.rb +6 -6
  38. data/test/fixtures/book_with_octal_pages.xml +2 -3
  39. data/test/test_helper.rb +1 -2
  40. data/test/unit/definition_test.rb +26 -27
  41. data/test/unit/deprecations_test.rb +23 -2
  42. data/test/unit/to_xml_test.rb +7 -7
  43. data/test/unit/xml_attribute_test.rb +3 -2
  44. data/test/unit/xml_block_test.rb +3 -2
  45. data/test/unit/xml_bool_test.rb +7 -8
  46. data/test/unit/xml_convention_test.rb +4 -3
  47. data/test/unit/xml_hash_test.rb +5 -13
  48. data/test/unit/xml_initialize_test.rb +4 -3
  49. data/test/unit/xml_name_test.rb +3 -2
  50. data/test/unit/xml_namespace_test.rb +4 -3
  51. data/test/unit/xml_object_test.rb +8 -7
  52. data/test/unit/xml_required_test.rb +7 -6
  53. data/test/unit/xml_text_test.rb +3 -2
  54. data/website/index.html +11 -11
  55. metadata +128 -60
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 0af38afb86b97b74c552f4ebd660722c4037154016838e4df2eb64626e2ab3fd
4
+ data.tar.gz: c95d035410a533947c04a41a772fdcbf778e0777bff5fbdf6a9515c97184afec
5
+ SHA512:
6
+ metadata.gz: c48cd9e91df3ced0445098e6c191d5475ec61baa44f61ecc8023d9b6e812079e96d877e4398418e991217165563d2dd3091f2449060483edad558e958c854f93
7
+ data.tar.gz: c45ca74b5168bf80e1d2133d8cc7a9036cb6c2b60fedbbda23df96b920cc89c47a5e5f84728dc3412aba5a2892447d3797e2472f718b12ebec22ae510d4b2760
data/.travis.yml ADDED
@@ -0,0 +1,14 @@
1
+ sudo: false
2
+ language: ruby
3
+ before_install:
4
+ - bundle update --bundler
5
+ rvm:
6
+ - 2.5.3
7
+ - 2.6.1
8
+ - 2.7.1
9
+ - 3.0.0
10
+ - ruby-head
11
+
12
+ matrix:
13
+ allow_failures:
14
+ - rvm: ruby-head
data/Gemfile CHANGED
@@ -1,12 +1,16 @@
1
1
  source "http://rubygems.org"
2
2
 
3
- gem 'activesupport', '>= 2.3.0'
3
+ gem 'activesupport', '>= 4.0'
4
4
  gem 'nokogiri', '>= 1.3.3'
5
5
 
6
6
  group :development, :test do
7
- gem 'rake'
8
- gem 'jeweler'
9
- gem "rspec", '>= 2.0.0'
10
- gem "sqlite3-ruby", '>= 1.2.4'
11
- gem "activerecord", '>= 2.2.2'
7
+ gem 'rake', '~> 0.9'
8
+ gem 'juwelier'
9
+ gem 'minitest'
10
+ gem 'rexml'
11
+ gem 'rspec', '~> 3.7.0'
12
+ gem 'sqlite3', '>= 1.2.4'
13
+ gem 'activerecord', '>= 4.0'
14
+ gem 'rack', '< 2.0.0'
15
+ gem 'equivalent-xml', '>= 0.6.0'
12
16
  end
data/Gemfile.lock CHANGED
@@ -1,50 +1,112 @@
1
1
  GEM
2
2
  remote: http://rubygems.org/
3
3
  specs:
4
- activemodel (3.1.3)
5
- activesupport (= 3.1.3)
6
- builder (~> 3.0.0)
7
- i18n (~> 0.6)
8
- activerecord (3.1.3)
9
- activemodel (= 3.1.3)
10
- activesupport (= 3.1.3)
11
- arel (~> 2.2.1)
12
- tzinfo (~> 0.3.29)
13
- activesupport (3.1.3)
14
- multi_json (~> 1.0)
15
- arel (2.2.1)
16
- builder (3.0.0)
17
- diff-lcs (1.1.3)
18
- git (1.2.5)
19
- i18n (0.6.0)
20
- jeweler (1.6.4)
21
- bundler (~> 1.0)
22
- git (>= 1.2.5)
4
+ activemodel (6.0.3.1)
5
+ activesupport (= 6.0.3.1)
6
+ activerecord (6.0.3.1)
7
+ activemodel (= 6.0.3.1)
8
+ activesupport (= 6.0.3.1)
9
+ activesupport (6.0.3.1)
10
+ concurrent-ruby (~> 1.0, >= 1.0.2)
11
+ i18n (>= 0.7, < 2)
12
+ minitest (~> 5.1)
13
+ tzinfo (~> 1.1)
14
+ zeitwerk (~> 2.2, >= 2.2.2)
15
+ addressable (2.8.0)
16
+ public_suffix (>= 2.0.2, < 5.0)
17
+ builder (3.2.4)
18
+ concurrent-ruby (1.1.6)
19
+ descendants_tracker (0.0.4)
20
+ thread_safe (~> 0.3, >= 0.3.1)
21
+ diff-lcs (1.3)
22
+ equivalent-xml (0.6.0)
23
+ nokogiri (>= 1.4.3)
24
+ faraday (0.17.3)
25
+ multipart-post (>= 1.2, < 3)
26
+ git (1.7.0)
27
+ rchardet (~> 1.8)
28
+ github_api (0.18.2)
29
+ addressable (~> 2.4)
30
+ descendants_tracker (~> 0.0.4)
31
+ faraday (~> 0.8)
32
+ hashie (~> 3.5, >= 3.5.2)
33
+ oauth2 (~> 1.0)
34
+ hashie (3.6.0)
35
+ highline (2.0.3)
36
+ i18n (1.8.3)
37
+ concurrent-ruby (~> 1.0)
38
+ juwelier (2.4.9)
39
+ builder
40
+ bundler
41
+ git
42
+ github_api
43
+ highline
44
+ kamelcase (~> 0)
45
+ nokogiri
46
+ psych
23
47
  rake
24
- multi_json (1.0.4)
25
- nokogiri (1.5.0)
26
- rake (0.9.2.2)
27
- rspec (2.8.0)
28
- rspec-core (~> 2.8.0)
29
- rspec-expectations (~> 2.8.0)
30
- rspec-mocks (~> 2.8.0)
31
- rspec-core (2.8.0)
32
- rspec-expectations (2.8.0)
33
- diff-lcs (~> 1.1.2)
34
- rspec-mocks (2.8.0)
35
- sqlite3 (1.3.5)
36
- sqlite3-ruby (1.3.3)
37
- sqlite3 (>= 1.3.3)
38
- tzinfo (0.3.31)
48
+ rdoc
49
+ semver2
50
+ jwt (2.2.1)
51
+ kamelcase (0.0.2)
52
+ semver2 (~> 3)
53
+ mini_portile2 (2.5.1)
54
+ minitest (5.14.4)
55
+ multi_json (1.14.1)
56
+ multi_xml (0.6.0)
57
+ multipart-post (2.1.1)
58
+ nokogiri (1.11.4)
59
+ mini_portile2 (~> 2.5.0)
60
+ racc (~> 1.4)
61
+ oauth2 (1.4.4)
62
+ faraday (>= 0.8, < 2.0)
63
+ jwt (>= 1.0, < 3.0)
64
+ multi_json (~> 1.3)
65
+ multi_xml (~> 0.5)
66
+ rack (>= 1.2, < 3)
67
+ psych (3.1.0)
68
+ public_suffix (4.0.6)
69
+ racc (1.5.2)
70
+ rack (1.6.13)
71
+ rake (0.9.6)
72
+ rchardet (1.8.0)
73
+ rdoc (6.3.2)
74
+ rexml (3.2.5)
75
+ rspec (3.7.0)
76
+ rspec-core (~> 3.7.0)
77
+ rspec-expectations (~> 3.7.0)
78
+ rspec-mocks (~> 3.7.0)
79
+ rspec-core (3.7.1)
80
+ rspec-support (~> 3.7.0)
81
+ rspec-expectations (3.7.0)
82
+ diff-lcs (>= 1.2.0, < 2.0)
83
+ rspec-support (~> 3.7.0)
84
+ rspec-mocks (3.7.0)
85
+ diff-lcs (>= 1.2.0, < 2.0)
86
+ rspec-support (~> 3.7.0)
87
+ rspec-support (3.7.1)
88
+ semver2 (3.4.2)
89
+ sqlite3 (1.4.2)
90
+ thread_safe (0.3.6)
91
+ tzinfo (1.2.7)
92
+ thread_safe (~> 0.1)
93
+ zeitwerk (2.3.0)
39
94
 
40
95
  PLATFORMS
41
96
  ruby
42
97
 
43
98
  DEPENDENCIES
44
- activerecord (>= 2.2.2)
45
- activesupport (>= 2.3.0)
46
- jeweler
99
+ activerecord (>= 4.0)
100
+ activesupport (>= 4.0)
101
+ equivalent-xml (>= 0.6.0)
102
+ juwelier
103
+ minitest
47
104
  nokogiri (>= 1.3.3)
48
- rake
49
- rspec (>= 2.0.0)
50
- sqlite3-ruby (>= 1.2.4)
105
+ rack (< 2.0.0)
106
+ rake (~> 0.9)
107
+ rexml
108
+ rspec (~> 3.7.0)
109
+ sqlite3 (>= 1.2.4)
110
+
111
+ BUNDLED WITH
112
+ 2.2.22
data/History.txt CHANGED
@@ -1,3 +1,12 @@
1
+ See github releases for versions > 3.3.1
2
+ https://github.com/Empact/roxml/releases
3
+
4
+ == 3.3.1 (February 10, 2012)
5
+
6
+ * bug fix
7
+
8
+ * Fix reading of VERSION file - Jari Bakken (jarib)
9
+
1
10
  == 3.3.0 (February 9, 2012)
2
11
 
3
12
  * major enhancement
data/README.rdoc CHANGED
@@ -1,10 +1,11 @@
1
1
  ROXML Ruby Object to XML mapping library.
2
2
 
3
+ {<img src="https://travis-ci.org/Empact/roxml.svg?branch=master" alt="Build Status" />}[https://travis-ci.org/Empact/roxml]
4
+
3
5
  For more information visit:
4
6
 
5
7
  http://rdoc.info/projects/Empact/roxml
6
8
  http://empact.github.com/roxml/
7
- http://rubyforge.org/projects/roxml/
8
9
 
9
10
  Please submit bugs here:
10
11
 
@@ -171,7 +172,7 @@ explicitly require one or the other, you may do the following:
171
172
  For more information on available annotations, see ROXML::ClassMethods::Declarations
172
173
 
173
174
  == Note on Patches/Pull Requests
174
-
175
+
175
176
  * Fork the project.
176
177
  * Make your feature addition or bug fix.
177
178
  * Add specs for it. This is important so I don't break it in a
data/Rakefile CHANGED
@@ -4,10 +4,9 @@ ENV['RUBY_FLAGS'] = '-W1'
4
4
 
5
5
  # Generate all the Rake tasks
6
6
  # Run 'rake -T' to see list of generated tasks (from gem root directory)
7
- require 'jeweler'
8
- Jeweler::Tasks.new do |gem|
7
+ require 'juwelier'
8
+ Juwelier::Tasks.new do |gem|
9
9
  gem.name = 'roxml'
10
- gem.rubyforge_project = "roxml"
11
10
  gem.summary = "Ruby Object to XML mapping library"
12
11
  gem.description = <<EOF
13
12
  ROXML is a Ruby library designed to make it easier for Ruby developers to work with XML.
@@ -17,12 +16,12 @@ building first-class Ruby classes. As a result, ROXML simplifies the development
17
16
  RESTful applications, Web Services, and XML-RPC.
18
17
  EOF
19
18
  gem.email = "ben.woosley@gmail.com"
20
- gem.homepage = "http://roxml.rubyforge.org"
19
+ gem.homepage = "https://github.com/Empact/roxml"
21
20
  gem.authors = ["Ben Woosley", "Zak Mandhro", "Anders Engstrom", "Russ Olsen"]
22
21
 
23
22
  gem.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.rdoc"]
24
23
  end
25
- Jeweler::GemcutterTasks.new
24
+ Juwelier::GemcutterTasks.new
26
25
 
27
26
  Dir['tasks/**/*.rake'].each { |t| load t }
28
27
 
@@ -68,10 +67,8 @@ end
68
67
 
69
68
  require 'rake/testtask'
70
69
  desc "Test ROXML using the default parser selection behavior"
71
- task :test do
72
- require 'rake/runtest'
73
- $LOAD_PATH << '.'
74
- Rake.run_tests 'test/unit/*_test.rb'
70
+ Rake::TestTask.new do |t|
71
+ t.test_files = FileList['test/**/*_test.rb']
75
72
  end
76
73
 
77
74
  namespace :test do
data/VERSION CHANGED
@@ -1 +1 @@
1
- 3.3.1
1
+ 4.2.0
@@ -0,0 +1,17 @@
1
+ #!/usr/bin/env ruby
2
+ require_relative './../spec/spec_helper'
3
+
4
+ class SearchQuery
5
+ include ROXML
6
+ xml_accessor :query
7
+ xml_accessor :max_results, :else => 20, :as => Integer
8
+ xml_accessor :language, :else => 'EN'
9
+ end
10
+
11
+
12
+ unless defined?(RSpec)
13
+ q = SearchQuery.new
14
+ q.query = "Some random query string."
15
+ puts q.to_xml.to_s
16
+ end
17
+
@@ -60,7 +60,7 @@ module ROXML
60
60
  @sought_type = :namespace
61
61
  elsif opts[:from].to_s.starts_with?('@')
62
62
  @sought_type = :attr
63
- opts[:from].sub!('@', '')
63
+ opts[:from] = opts[:from].sub('@', '')
64
64
  end
65
65
 
66
66
  @name = @attr_name = accessor.to_s.chomp('?')
@@ -140,12 +140,12 @@ module ROXML
140
140
  default
141
141
  end
142
142
  end
143
-
143
+
144
144
  CORE_BLOCK_SHORTHANDS = {
145
145
  # Core Shorthands
146
146
  Integer => lambda do |val|
147
147
  all(val) do |v|
148
- Integer(v) unless v.blank?
148
+ v.to_i unless v.blank?
149
149
  end
150
150
  end,
151
151
  Float => lambda do |val|
@@ -153,11 +153,6 @@ module ROXML
153
153
  Float(v) unless v.blank?
154
154
  end
155
155
  end,
156
- Fixnum => lambda do |val|
157
- all(val) do |v|
158
- v.to_i unless v.blank?
159
- end
160
- end,
161
156
  Time => lambda do |val|
162
157
  all(val) {|v| Time.parse(v) unless v.blank? }
163
158
  end,
@@ -181,7 +176,7 @@ module ROXML
181
176
  CORE_BLOCK_SHORTHANDS.tap do |blocks|
182
177
  blocks.reverse_merge!(BigDecimal => lambda do |val|
183
178
  all(val) do |v|
184
- BigDecimal.new(v) unless v.blank?
179
+ BigDecimal(v) unless v.blank?
185
180
  end
186
181
  end) if defined?(BigDecimal)
187
182
 
@@ -1,5 +1,5 @@
1
1
  module ROXML
2
- class RequiredElementMissing < Exception # :nodoc:
2
+ class RequiredElementMissing < ArgumentError # :nodoc:
3
3
  end
4
4
 
5
5
  #
@@ -32,8 +32,9 @@ module ROXML
32
32
  end
33
33
 
34
34
  def value_in(xml)
35
- value = fetch_value(XML::Node.from(xml))
36
- value = default if value.nil?
35
+ xml = XML::Node.from(xml)
36
+ value = fetch_value(xml)
37
+ value = default if default && (value.nil? || value.to_s.empty?)
37
38
 
38
39
  value = apply_blocks(value)
39
40
  value = freeze(value) if value && opts.frozen?
@@ -44,19 +45,33 @@ module ROXML
44
45
  def conventionize(what)
45
46
  convention ||= @instance.class.respond_to?(:roxml_naming_convention) && @instance.class.roxml_naming_convention
46
47
  if !what.blank? && convention.respond_to?(:call)
47
- URI.unescape(convention.call(URI.escape(what, /\/|::/)))
48
+ URI.decode_www_form_component(convention.call(URI.encode_www_form_component(what)))
48
49
  else
49
50
  what
50
51
  end
51
52
  end
52
53
 
53
54
  def namespacify(what)
54
- if what.to_s.present? && !what.to_s.include?(':') && opts.namespace != false
55
- [opts.namespace, @instance.class.roxml_namespace, @default_namespace].each do |namespace|
56
- return opts.namespace == '*' ? (what == '*' ? "*" : "*[local-name()='#{what}']") : "#{namespace}:#{what}" if namespace
55
+ if what.to_s.present? && opts.namespace != false && ns = [opts.namespace, @instance.class.roxml_namespace, @default_namespace].compact.map(&:to_s).first
56
+ require "rexml/xpath_parser"
57
+
58
+ parser = REXML::Parsers::XPathParser.new
59
+ parsed = parser.parse what
60
+
61
+ parsed.each_cons(4).with_index.each do |a,i|
62
+ if a[0..2] == [:child, :qname, ""]
63
+ if ns == "*"
64
+ parsed[i+1,3] = [:any, :predicate, [:eq, [:function, "local-name", []], [:literal, a[3]]]] if a[3] != "*"
65
+ else
66
+ a[2].replace ns
67
+ end
68
+ end
57
69
  end
70
+
71
+ parser.abbreviate parsed
72
+ else
73
+ what
58
74
  end
59
- what
60
75
  end
61
76
 
62
77
  def apply_blocks(val)
@@ -87,7 +102,7 @@ module ROXML
87
102
  end
88
103
 
89
104
  def wrap(xml, opts = {:always_create => false})
90
- wrap_with = @auto_vals ? auto_wrapper : wrapper
105
+ wrap_with = defined?(@auto_vals) && @auto_vals ? auto_wrapper : wrapper
91
106
 
92
107
  return xml if !wrap_with || xml.name == wrap_with
93
108
 
data/lib/roxml.rb CHANGED
@@ -42,6 +42,9 @@ module ROXML # :nodoc:
42
42
  ref.update_xml(root, value)
43
43
  end
44
44
  end
45
+ if params[:namespaces]
46
+ params[:namespaces].each { |prefix, url| root.add_namespace_definition(prefix, url) }
47
+ end
45
48
  end
46
49
  end
47
50
  end
@@ -89,7 +92,7 @@ module ROXML # :nodoc:
89
92
  def xml_namespace(namespace)
90
93
  @roxml_namespace = namespace.to_s
91
94
  end
92
-
95
+
93
96
  # Sets up a mapping of namespace prefixes to hrefs, to be used by this class.
94
97
  # These namespace prefixes are independent of what appears in the xml, only
95
98
  # the namespace hrefs themselves need to match
@@ -125,7 +128,11 @@ module ROXML # :nodoc:
125
128
  end
126
129
 
127
130
  def roxml_namespaces # :nodoc:
128
- @roxml_namespaces || {}
131
+ if defined? @roxml_namespaces
132
+ @roxml_namespaces
133
+ else
134
+ {}
135
+ end
129
136
  end
130
137
 
131
138
  # Most xml documents have a consistent naming convention, for example, the node and
@@ -160,7 +167,7 @@ module ROXML # :nodoc:
160
167
  # Note that the xml_convention is also applied to the default root-level tag_name,
161
168
  # but in this case an underscored version of the name is applied, for convenience.
162
169
  def xml_convention(to_proc_able = nil, &block)
163
- raise ArgumentError, "conventions are already set" if @roxml_naming_convention
170
+ raise ArgumentError, "conventions are already set" if defined?(@roxml_naming_convention)
164
171
  @roxml_naming_convention =
165
172
  if to_proc_able
166
173
  raise ArgumentError, "only one conventions can be set" if block_given?
@@ -171,8 +178,10 @@ module ROXML # :nodoc:
171
178
  end
172
179
 
173
180
  def roxml_naming_convention # :nodoc:
174
- @roxml_naming_convention || begin
175
- superclass.roxml_naming_convention if superclass.respond_to?(:roxml_naming_convention)
181
+ if defined? @roxml_naming_convention
182
+ @roxml_naming_convention
183
+ elsif superclass.respond_to?(:roxml_naming_convention)
184
+ superclass.roxml_naming_convention
176
185
  end
177
186
  end
178
187
 
@@ -260,7 +269,7 @@ module ROXML # :nodoc:
260
269
  #
261
270
  # xml_reader(:count) {|val| Integer(val) unless val.empty? }
262
271
  #
263
- # Such block shorthands for Integer, Float, Fixnum, BigDecimal, Date, Time, and DateTime
272
+ # Such block shorthands for Integer, Float, BigDecimal, Date, Time, and DateTime
264
273
  # are currently available, but only for non-Hash declarations.
265
274
  #
266
275
  # To reference many elements, put the desired type in a literal array. e.g.:
@@ -434,7 +443,7 @@ module ROXML # :nodoc:
434
443
  # === Other Options
435
444
  # [:in] An optional name of a wrapping tag for this XML accessor.
436
445
  # This can include other xpath values, which will be joined with :from with a '/'
437
- # [:else] Default value for attribute, if missing from the xml on .from_xml
446
+ # [:else] Default value for attribute, if missing from the xml (or it's there but its contents are blank) on .from_xml
438
447
  # [:required] If true, throws RequiredElementMissing when the element isn't present
439
448
  # [:frozen] If true, all results are frozen (using #freeze) at parse-time.
440
449
  # [:cdata] true for values which should be input from or output as cdata elements
@@ -479,6 +488,9 @@ module ROXML # :nodoc:
479
488
  private
480
489
  def add_reader(attr)
481
490
  define_method(attr.accessor) do
491
+ unless instance_variable_defined?(attr.instance_variable_name)
492
+ instance_variable_set(attr.instance_variable_name, attr.default)
493
+ end
482
494
  instance_variable_get(attr.instance_variable_name)
483
495
  end
484
496
  end
@@ -495,21 +507,25 @@ module ROXML # :nodoc:
495
507
  # do not work without one.
496
508
  def tag_name
497
509
  return roxml_tag_name if roxml_tag_name
498
-
510
+
499
511
  if tag_name = name.split('::').last
500
512
  roxml_naming_convention ? roxml_naming_convention.call(tag_name.underscore) : tag_name.downcase
501
513
  end
502
514
  end
503
515
 
504
516
  def roxml_tag_name # :nodoc:
505
- @roxml_tag_name || begin
506
- superclass.roxml_tag_name if superclass.respond_to?(:roxml_tag_name)
517
+ if defined? @roxml_tag_name
518
+ @roxml_tag_name
519
+ elsif superclass.respond_to?(:roxml_tag_name)
520
+ superclass.roxml_tag_name
507
521
  end
508
522
  end
509
523
 
510
524
  def roxml_namespace # :nodoc:
511
- @roxml_namespace || begin
512
- superclass.roxml_namespace if superclass.respond_to?(:roxml_namespace)
525
+ if defined? @roxml_namespace
526
+ @roxml_namespace
527
+ elsif superclass.respond_to?(:roxml_namespace)
528
+ superclass.roxml_namespace
513
529
  end
514
530
  end
515
531
 
@@ -561,4 +577,3 @@ module ROXML # :nodoc:
561
577
  end
562
578
  end
563
579
  end
564
-