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.
98 99 100 |
# File 'lib/mustermann/string_scanner.rb', line 98 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.
79 80 81 |
# File 'lib/mustermann/string_scanner.rb', line 79 def length @length end |
#params ⇒ Hash (readonly)
Params parsed from the substring. Will not include params from previous scan results.
95 96 97 |
# File 'lib/mustermann/string_scanner.rb', line 95 def params @params end |
#position ⇒ Integer (readonly) Also known as: pos
Returns position the substring starts at.
68 69 70 |
# File 'lib/mustermann/string_scanner.rb', line 68 def position @position end |
#scanner ⇒ Object (readonly)
The scanner this result came from.
58 59 60 |
# File 'lib/mustermann/string_scanner.rb', line 58 def scanner @scanner end |