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

#pathObject



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

def path; @text.path; end

#textObject



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

def text; @text.content; end

#text=(t) ⇒ Object



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

def text=(t); @text.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; @text.content.to_f; end

#to_iObject



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

def to_i; @text.content.to_i; end

#to_sObject



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

def to_s; @text.content.to_s; end