Class: Teepee::Token

Inherits:
ParserNode show all
Defined in:
lib/teepee/token.rb

Direct Known Subclasses

NumberToken, SingleCharacterToken, StringToken

Class Method Summary collapse

Methods inherited from ParserNode

#to_html, #use_scope

Class Method Details

.matches?(text) ⇒ Boolean

The child classes should implement this method. If there is an immediate match, they should return a newly-created instance of themselves and the rest of the input as a string. If there is no match, they should return nil.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


47
48
49
50
# File 'lib/teepee/token.rb', line 47

def matches? text
  raise NotImplementedError,
        "Child class #{self.class} should implement this."
end