Class: Gumbo::Text
Direct Known Subclasses
Instance Attribute Summary collapse
- #original_text ⇒ Object readonly
- #start_pos ⇒ Object readonly
- #text ⇒ Object readonly
Attributes inherited from Node
Instance Method Summary collapse
-
#offset_range ⇒ Object
The byte offset range where this node was extracted from, or nil if it was inserted algorithmically.
- #to_s ⇒ Object (also: #inspect)
Methods inherited from Node
Instance Attribute Details
#original_text ⇒ Object (readonly)
#start_pos ⇒ Object (readonly)
#text ⇒ Object (readonly)
Instance Method Details
#offset_range ⇒ Object
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_s ⇒ Object Also known as: inspect
18 19 20 |
# File 'lib/gumbo/text.rb', line 18 def to_s original_text end |