diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-16 17:47:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-10-16 17:47:19 +0000 |
commit | 8ef5da3be1577bb5ae7f55b60cf9fedb10ecb85e (patch) | |
tree | a700e3fe92165180b04451746f9c4fda4f038289 /lib/rexml/element.rb | |
parent | 3ec0bc3828794a6ef6293b53b403af8bc2362934 (diff) | |
download | ruby-8ef5da3be1577bb5ae7f55b60cf9fedb10ecb85e.tar.gz |
consistent parentheses in assignment RHS.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4790 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/rexml/element.rb')
-rw-r--r-- | lib/rexml/element.rb | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/rexml/element.rb b/lib/rexml/element.rb index 89e419345c..ffaeddbf54 100644 --- a/lib/rexml/element.rb +++ b/lib/rexml/element.rb @@ -52,8 +52,8 @@ module REXML def initialize( arg = UNDEFINED, parent=nil, context=nil ) super(parent) - @elements = Elements.new self - @attributes = Attributes.new self + @elements = Elements.new(self) + @attributes = Attributes.new(self) @context = context if arg.kind_of? String @@ -253,7 +253,7 @@ module REXML # el = Element.new 'my-tag' # doc.add_element el def add_element element=nil, attrs=nil - el = @elements.add element + el = @elements.add(element) if attrs.kind_of? Hash attrs.each do |key, value| el.attributes[key]=value if key =~ /^xmlns:/ @@ -412,7 +412,7 @@ module REXML # # The element 'p' has two text elements, "some text " and " more text". # doc.root.text #-> "some text " def text( path = nil ) - rv = get_text path + rv = get_text(path) return rv.value unless rv.nil? nil end @@ -724,7 +724,7 @@ module REXML def []( index, name=nil) if index.kind_of? Integer raise "index (#{index}) must be >= 1" if index < 1 - name = literalize name if name + name = literalize(name) if name num = 0 child = nil @element.find { |child| @@ -1016,13 +1016,13 @@ module REXML # doc.root.attributes['x:foo'] = nil def []=( name, value ) if value.nil? # Delete the named attribute - attr = get_attribute name + attr = get_attribute(name) delete attr return end value = Attribute.new(name, value) unless value.kind_of? Attribute value.element = @element - old_attr = fetch value.name, nil + old_attr = fetch(value.name, nil) if old_attr.nil? store(value.name, value) elsif old_attr.kind_of? Hash @@ -1104,7 +1104,7 @@ module REXML prefix, name = $1, $2 prefix = '' unless prefix end - old = fetch name, nil + old = fetch(name, nil) attr = nil if old.kind_of? Hash # the supplied attribute is one of many attr = old.delete(prefix) |