Class: VCDOM::AttrNS

Inherits:
Attr
  • Object
show all
Defined in:
lib/vcdom/attr_ns.rb

Instance Method Summary collapse

Methods inherited from Attr

#_set_owner_element, #append_child, #node_type, #owner_element, #value, #value=

Constructor Details

#initialize(doc, namespace_uri, prefix, local_name) ⇒ AttrNS

Returns a new instance of AttrNS.



9
10
11
12
13
# File 'lib/vcdom/attr_ns.rb', line 9

def initialize( doc, namespace_uri, prefix, local_name )
  super( doc, local_name )
  @namespace_uri = namespace_uri
  @prefix = prefix
end

Instance Method Details

#local_nameObject



30
31
32
# File 'lib/vcdom/attr_ns.rb', line 30

def local_name
  @local_name.to_s()
end

#nameObject Also known as: node_name



15
16
17
18
19
20
21
# File 'lib/vcdom/attr_ns.rb', line 15

def name
  if @prefix then
    "#{@prefix.to_s}:#{@local_name.to_s}"
  else
    @local_name.to_s()
  end
end

#namespace_uriObject



33
34
35
# File 'lib/vcdom/attr_ns.rb', line 33

def namespace_uri
  @namespace_uri.nil? ? nil : @namespace_uri.to_s()
end

#prefixObject



24
25
26
# File 'lib/vcdom/attr_ns.rb', line 24

def prefix
  @prefix.nil? ? nil : @prefix.to_s()
end

#prefix=(val) ⇒ Object



27
28
29
# File 'lib/vcdom/attr_ns.rb', line 27

def prefix=(val)
  @prefix = val.nil? ? nil : val.intern
end