Class: Mustermann::StringScanner::ScanResult
- Inherits:
-
String
- Object
- String
- Mustermann::StringScanner::ScanResult
- Defined in:
- lib/mustermann/string_scanner.rb
Overview
Instance Attribute Summary collapse
-
#length ⇒ Integer
readonly
Length of the substring.
-
#params ⇒ Hash
readonly
Params parsed from the substring.
-
#position ⇒ Integer
(also: #pos)
readonly
Position the substring starts at.
-
#scanner ⇒ Object
readonly
The scanner this result came from.
Instance Method Summary collapse
-
#initialize(scanner, position, length, params = {}) ⇒ ScanResult
constructor
private
A new instance of ScanResult.
Constructor Details
#initialize(scanner, position, length, params = {}) ⇒ ScanResult
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of ScanResult.
97 98 99 |
# File 'lib/mustermann/string_scanner.rb', line 97 def initialize(scanner, position, length, params = {}) @scanner, @position, @length, @params = scanner, position, length, params end |
Instance Attribute Details
#length ⇒ Integer (readonly)
Returns length of the substring.
78 79 80 |
# File 'lib/mustermann/string_scanner.rb', line 78 def length @length end |
#params ⇒ Hash (readonly)
Params parsed from the substring. Will not include params from previous scan results.
94 95 96 |
# File 'lib/mustermann/string_scanner.rb', line 94 def params @params end |
#position ⇒ Integer (readonly) Also known as: pos
Returns position the substring starts at.
67 68 69 |
# File 'lib/mustermann/string_scanner.rb', line 67 def position @position end |
#scanner ⇒ Object (readonly)
The scanner this result came from.
57 58 59 |
# File 'lib/mustermann/string_scanner.rb', line 57 def scanner @scanner end |