class 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/openid/yadis/htmltokenizer.rb, line 177
def initialize(text)
  @raw = text
end

Public Instance Methods

==(other) click to toggle source

Compare to another based on the raw source

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

By default tokens have no text representation

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

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

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