Class: Gamefic::Scanner::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic/scanner/base.rb

Overview

A base class for scanners that match tokens to entities.

Direct Known Subclasses

Nesting, Strict

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(selection, token) ⇒ Base

Returns a new instance of Base.

Parameters:



16
17
18
19
# File 'lib/gamefic/scanner/base.rb', line 16

def initialize selection, token
  @selection = selection
  @token = token
end

Instance Attribute Details

#selectionArray<Entity> (readonly)

Returns:



9
10
11
# File 'lib/gamefic/scanner/base.rb', line 9

def selection
  @selection
end

#tokenString (readonly)

Returns:



12
13
14
# File 'lib/gamefic/scanner/base.rb', line 12

def token
  @token
end

Class Method Details

.scan(selection, token) ⇒ Result

Parameters:

Returns:



29
30
31
# File 'lib/gamefic/scanner/base.rb', line 29

def self.scan selection, token
  new(selection, token).scan
end

Instance Method Details

#scanResult

Returns:



22
23
24
# File 'lib/gamefic/scanner/base.rb', line 22

def scan
  unmatched_result
end