Parent

HTMLToken

The parent class for all three types of HTML tokens

Attributes

raw[RW]

Public Class Methods

new(text) click to toggle source

Initialize the token based on the raw text

# File lib/yadis/htmltokenizer.rb, line 174
def initialize(text)
  @raw = text
end

Public Instance Methods

==(other) click to toggle source

Compare to another based on the raw source

# File lib/yadis/htmltokenizer.rb, line 193
def ==(other)
  raw == other.to_s
end
text() click to toggle source

By default tokens have no text representation

# File lib/yadis/htmltokenizer.rb, line 184
def text
  ""
end
to_s() click to toggle source

By default, return exactly the string used to create the text

# File lib/yadis/htmltokenizer.rb, line 179
def to_s
  raw
end
trimmed_text() click to toggle source
# File lib/yadis/htmltokenizer.rb, line 188
def trimmed_text
  text.strip.gsub(/\s+/, " ")
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.