Module
Adds named attributes to an object.
Constants
No documentation available
Attributes
Read
The name of the object, valid if set
Read
The name of the object, valid if set
Read & Write
The expanded name of the object, valid if name is set
Read
The name of the object, valid if set
Instance Methods
lib/rexml/namespace.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rexml/namespace.rb, line 42
def fully_expanded_name
ns = prefix
return "#{ns}:#@name" if ns.size > 0
return @name
end
Fully expand the name, even if the prefix wasn’t specified in the source file.
lib/rexml/namespace.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rexml/namespace.rb, line 28
def has_name?( other, ns=nil )
if ns
return (namespace() == ns and name() == other)
elsif other.include? ":"
return fully_expanded_name == other
else
return name == other
end
end
Compares names optionally WITH namespaces
lib/rexml/namespace.rb
View on GitHub
# File tmp/rubies/ruby-2.4.10/lib/rexml/namespace.rb, line 15
def name=( name )
@expanded_name = name
name =~ NAMESPLIT
if $1
@prefix = $1
else
@prefix = ""
@namespace = ""
end
@name = $2
end
Sets the name and the expanded name