Class: RBelly::Lexeme
- Inherits:
-
Object
- Object
- RBelly::Lexeme
- Defined in:
- lib/rbelly/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/rbelly/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/rbelly/lexeme.rb', line 5 def name @name end |
#pattern ⇒ Object (readonly)
Returns the value of attribute pattern.
5 6 7 |
# File 'lib/rbelly/lexeme.rb', line 5 def pattern @pattern end |