class Rugments::RegexLexer::Rule
A rule is a tuple of a regular expression to test, and a callback to perform if the test succeeds.
Attributes
beginning_of_line[R]
callback[R]
re[R]
Public Class Methods
new(re, callback)
click to toggle source
# File lib/rugments/regex_lexer.rb, line 14 def initialize(re, callback) @re = re @callback = callback @beginning_of_line = re.source[0] == '^' end
Public Instance Methods
inspect()
click to toggle source
# File lib/rugments/regex_lexer.rb, line 20 def inspect "#<Rule #{@re.inspect}>" end