class XML::Smart::QName

Public Class Methods

new(element) click to toggle source
# File lib/xml/smart_qname.rb, line 5
def initialize(element); @element = element; end

Public Instance Methods

+(str) click to toggle source
# File lib/xml/smart_qname.rb, line 9
def +(str); @element.name + str; end
==(str) click to toggle source
# File lib/xml/smart_qname.rb, line 7
def ==(str); @element.name == str; end
===(cls) click to toggle source
# File lib/xml/smart_qname.rb, line 8
def ===(cls); self.is_a? cls; end
href() click to toggle source
# File lib/xml/smart_qname.rb, line 28
def href
  @element.namespace ? @element.namespace.href : nil
end
name() click to toggle source
# File lib/xml/smart_qname.rb, line 13
def name; @element.name; end
name=(n) click to toggle source
# File lib/xml/smart_qname.rb, line 14
def name=(n); @element.name = n; end
prefix() click to toggle source
# File lib/xml/smart_qname.rb, line 16
def prefix
  if @element.namespace 
    if @element.namespace.prefix.nil?
      ''
    else  
      @element.namespace.prefix
    end  
  else
    nil
  end
end
to_s() click to toggle source
# File lib/xml/smart_qname.rb, line 11
def to_s; (prefix.nil? || prefix == '' ? '' : prefix + ':') + @element.name; end
to_sym() click to toggle source
# File lib/xml/smart_qname.rb, line 12
def to_sym; to_s.to_sym; end