class RougeLines::RegexLexer::Rule

A rule is a tuple of a regular expression to test, and a callback to perform if the test succeeds.

@see StateDSL#rule

Attributes

beginning_of_line[R]
callback[R]
re[R]

Public Class Methods

new(re, callback) click to toggle source
# File lib/rouge-lines/regex_lexer.rb, line 15
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/rouge-lines/regex_lexer.rb, line 21
def inspect
  "#<Rule #{@re.inspect}>"
end