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