Class: Spectre::Match
- Inherits:
-
Object
- Object
- Spectre::Match
- Defined in:
- lib/spectre/base/parser.rb
Overview
Keeps the match a Parser made.
Instance Attribute Summary collapse
-
#length ⇒ Object
The size of the consumed input - Integer.
-
#value ⇒ Object
The value extracted by the parsing process.
Instance Method Summary collapse
-
#initialize(length = 0, value = nil) ⇒ Match
constructor
Initializes a new Match object with the
length
of the consumed input and thevalue
returned by the parsing process.
Constructor Details
#initialize(length = 0, value = nil) ⇒ Match
Initializes a new Match object with the length
of the consumed input and the value
returned by the parsing process.
38 39 40 |
# File 'lib/spectre/base/parser.rb', line 38 def initialize length = 0, value = nil @length, @value = length, value end |
Instance Attribute Details
#length ⇒ Object
The size of the consumed input - Integer.
28 29 30 |
# File 'lib/spectre/base/parser.rb', line 28 def length @length end |
#value ⇒ Object
The value extracted by the parsing process.
32 33 34 |
# File 'lib/spectre/base/parser.rb', line 32 def value @value end |