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)
  @attr = 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(@attr.parent); end

#pathObject



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

def path; @attr.path; end

#qnameObject



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

def qname; QName.new @attr; end

#to_fObject



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

def to_f; @attr.content.to_f; end

#to_iObject



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

def to_i; @attr.content.to_i; end

#to_sObject



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

def to_s; @attr.content; end

#unique_idObject



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

def unique_id; @attr.pointer_id; end

#valueObject



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

def value;  @attr.content; end

#value=(val) ⇒ Object



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

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