class Rouge::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/regex_lexer.rb, line 16
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/regex_lexer.rb, line 22
def inspect
  "#<Rule #{@re.inspect}>"
end