class Gamefic::Scanner::Base
A base class for scanners that match tokens to entities.
Attributes
@return [Array<Entity>]
@return [String]
Public Class Methods
Source
# File lib/gamefic/scanner/base.rb, line 16 def initialize selection, token @selection = selection @token = token end
@param selection [Array<Entity>] @param token [String]
Source
# File lib/gamefic/scanner/base.rb, line 29 def self.scan selection, token new(selection, token).scan end
@param selection [Array<Entity>] @param token [String] @return [Result]
Public Instance Methods
Source
# File lib/gamefic/scanner/base.rb, line 22 def scan unmatched_result end
@return [Result]
Private Instance Methods
Source
# File lib/gamefic/scanner/base.rb, line 39 def matched_result matched, remainder Result.new(selection, token, matched, remainder, self.class) end
Source
# File lib/gamefic/scanner/base.rb, line 35 def unmatched_result Result.unmatched(selection, token, self.class) end