summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-04 18:37:46 +0000
committerzzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-08-04 18:37:46 +0000
commite730b1aa73b8fe833d8b8d9e05a9c81e5410ec83 (patch)
tree46f792704912c3cdaea668cb5eee894e6daf895e /lib
parent07e3b30c8498672541200d22cf7b77d7a090a958 (diff)
* lib/rexml/attribute.rb: [DOC] Update example for #namespace
Patch by Ippei Obayashi [Bug #8685] [ruby-core:56173] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42376 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/rexml/attribute.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/rexml/attribute.rb b/lib/rexml/attribute.rb
index e99927943f..803d0217b1 100644
--- a/lib/rexml/attribute.rb
+++ b/lib/rexml/attribute.rb
@@ -80,8 +80,11 @@ module REXML
# Returns the namespace URL, if defined, or nil otherwise
#
# e = Element.new("el")
- # e.add_attributes({"xmlns:ns", "http://url"})
- # e.namespace( "ns" ) # -> "http://url"
+ # e.add_namespace("ns", "http://url")
+ # e.add_attribute("ns:a", "b")
+ # e.add_attribute("nsx:a", "c")
+ # e.attribute("ns:a").namespace # => "http://url"
+ # e.attribute("nsx:a").namespace # => nil
def namespace arg=nil
arg = prefix if arg.nil?
@element.namespace arg