Class: Rouge::RegexLexer::State

Inherits:
Object
  • Object
show all
Defined in:
lib/rouge/regex_lexer.rb

Overview

a State is a named set of rules that can be tested for or mixed in.

See Also:

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, rules) ⇒ State

Returns a new instance of State.



31
32
33
34
# File 'lib/rouge/regex_lexer.rb', line 31

def initialize(name, rules)
  @name = name
  @rules = rules
end

Instance Attribute Details

#nameObject (readonly)

Returns the value of attribute name.



30
31
32
# File 'lib/rouge/regex_lexer.rb', line 30

def name
  @name
end

#rulesObject (readonly)

Returns the value of attribute rules.



30
31
32
# File 'lib/rouge/regex_lexer.rb', line 30

def rules
  @rules
end

Instance Method Details

#inspectObject



36
37
38
# File 'lib/rouge/regex_lexer.rb', line 36

def inspect
  "#<#{self.class.name} #{@name.inspect}>"
end