class HTMLToken
The parent class for all three types of HTML tokens
Attributes
Public Class Methods
Source
# File lib/yadis/htmltokenizer.rb, line 174 def initialize(text) @raw = text end
Initialize the token based on the raw text
Public Instance Methods
Source
# File lib/yadis/htmltokenizer.rb, line 193 def ==(other) raw == other.to_s end
Compare to another based on the raw source
Source
# File lib/yadis/htmltokenizer.rb, line 184 def text "" end
By default tokens have no text representation
Source
# File lib/yadis/htmltokenizer.rb, line 179 def to_s raw end
By default, return exactly the string used to create the text
Source
# File lib/yadis/htmltokenizer.rb, line 188 def trimmed_text text.strip.gsub(/\s+/m, " ") end