class Gamefic::Scanner::Result
The result of an attempt to scan objects against a token in a Scanner
. It provides an array of matching objects, the text that matched them, and the text that remains unmatched.
Attributes
The matched objects
@return [Array<Entity>, String]
The matched objects
@return [Array<Entity>, String]
The remaining (unmatched) portion of the token
@return [String]
The scanned objects
@return [Array<Entity>, String
, Regexp]
The scanned token
@return [String]
Public Class Methods
Source
# File lib/gamefic/scanner/result.rb, line 33 def initialize scanned, token, matched, remainder, processor @scanned = scanned @token = token @matched = matched @remainder = remainder @processor = processor end
Source
# File lib/gamefic/scanner/result.rb, line 58 def self.unmatched scanned, token, processor new(scanned, token, [], token, processor) end
Public Instance Methods
Source
# File lib/gamefic/scanner/result.rb, line 48 def filter *args Scanner::Result.new( scanned, token, match.that_are(*args), remainder, processor ) end
Source
# File lib/gamefic/scanner/result.rb, line 44 def strictness @strictness ||= Scanner.strictness(processor) end
The strictness of the scanner that produced this result.
@return [Integer]