Class: Gumbo::Text

Inherits:
Node
  • Object
show all
Defined in:
ext/ruby_gumbo_ext.c,
lib/gumbo/text.rb

Direct Known Subclasses

CData, Comment, Whitespace

Instance Attribute Summary collapse

Attributes inherited from Node

#parent, #parse_flags, #type

Instance Method Summary collapse

Methods inherited from Node

#dump_tree

Instance Attribute Details

#original_textObject (readonly)

#start_posObject (readonly)

#textObject (readonly)

Instance Method Details

#offset_rangeObject

The byte offset range where this node was extracted from, or nil if it was inserted algorithmically.



25
26
27
28
# File 'lib/gumbo/text.rb', line 25

def offset_range
  return nil unless original_text
  start_pos.offset...(start_pos.offset + original_text.bytesize)
end

#to_sObject Also known as: inspect



18
19
20
# File 'lib/gumbo/text.rb', line 18

def to_s
  original_text
end