Class: RKelly::Lexeme
- Inherits:
-
Object
- Object
- RKelly::Lexeme
- Defined in:
- lib/rkelly/lexeme.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#pattern ⇒ Object
readonly
Returns the value of attribute pattern.
Instance Method Summary collapse
-
#initialize(name, pattern, &block) ⇒ Lexeme
constructor
A new instance of Lexeme.
- #match(string) ⇒ Object
Constructor Details
#initialize(name, pattern, &block) ⇒ Lexeme
Returns a new instance of Lexeme.
6 7 8 9 10 |
# File 'lib/rkelly/lexeme.rb', line 6 def initialize(name, pattern, &block) @name = name @pattern = pattern @block = block end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
5 6 7 |
# File 'lib/rkelly/lexeme.rb', line 5 def name @name end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/rkelly/lexeme.rb', line 5 def pattern @pattern end |