Class: XML::Smart::Dom::Attribute

Inherits:
Object
  • Object
show all
Defined in:
lib/xml/smart_domattribute.rb

Instance Method Summary collapse

Constructor Details

#initialize(attr) ⇒ Attribute

Returns a new instance of Attribute.



6
7
8
# File 'lib/xml/smart_domattribute.rb', line 6

def initialize(attr)
  @node = attr
end

Instance Method Details

#==(other) ⇒ Object



22
23
24
25
26
# File 'lib/xml/smart_domattribute.rb', line 22

def ==(other)
  return false unless other
  return false unless other.respond_to?(:unique_id)
  unique_id == other.unique_id
end

#===(cls) ⇒ Object



10
# File 'lib/xml/smart_domattribute.rb', line 10

def ===(cls); self.is_a? cls; end

#parentObject



29
# File 'lib/xml/smart_domattribute.rb', line 29

def parent; Dom::smart_helper(@node.parent); end

#pathObject



17
# File 'lib/xml/smart_domattribute.rb', line 17

def path; @node.path; end

#qnameObject



16
# File 'lib/xml/smart_domattribute.rb', line 16

def qname; QName.new @node; end

#to_fObject



14
# File 'lib/xml/smart_domattribute.rb', line 14

def to_f; @node.content.to_f; end

#to_iObject



13
# File 'lib/xml/smart_domattribute.rb', line 13

def to_i; @node.content.to_i; end

#to_sObject



12
# File 'lib/xml/smart_domattribute.rb', line 12

def to_s; @node.content; end

#unique_idObject



27
# File 'lib/xml/smart_domattribute.rb', line 27

def unique_id; @node.pointer_id; end

#valueObject Also known as: text



19
# File 'lib/xml/smart_domattribute.rb', line 19

def value;  @node.content; end

#value=(val) ⇒ Object Also known as: text=



20
# File 'lib/xml/smart_domattribute.rb', line 20

def value=(val); @node.content = val; end