Class: XML::Smart::Dom::Text

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

Direct Known Subclasses

Other

Instance Method Summary collapse

Constructor Details

#initialize(text) ⇒ Text

Returns a new instance of Text.



6
# File 'lib/xml/smart_domtext.rb', line 6

def initialize(text); @node = text; end

Instance Method Details

#===(cls) ⇒ Object



8
# File 'lib/xml/smart_domtext.rb', line 8

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

#dumpObject



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

def dump; to_s; end

#parentObject



18
# File 'lib/xml/smart_domtext.rb', line 18

def parent; Node.new(@node.parent); end

#pathObject



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

def path; @node.path; end

#textObject



15
# File 'lib/xml/smart_domtext.rb', line 15

def text; @node.content; end

#text=(t) ⇒ Object



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

def text=(t); @node.content = t.to_s if t.respond_to? :to_s; end

#to_fObject



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

def to_f; @node.content.to_f; end

#to_iObject



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

def to_i; @node.content.to_i; end

#to_sObject



11
# File 'lib/xml/smart_domtext.rb', line 11

def to_s; @node.content.to_s; end