Class: Gamefic::Scanner::Base
- Inherits:
-
Object
- Object
- Gamefic::Scanner::Base
- Defined in:
- lib/gamefic/scanner/base.rb
Overview
A base class for scanners that match tokens to entities.
Instance Attribute Summary collapse
- #selection ⇒ Array<Entity> readonly
- #token ⇒ String readonly
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(selection, token) ⇒ Base
constructor
A new instance of Base.
- #scan ⇒ Result
Constructor Details
#initialize(selection, token) ⇒ Base
Returns a new instance of Base.
16 17 18 19 |
# File 'lib/gamefic/scanner/base.rb', line 16 def initialize selection, token @selection = selection @token = token end |
Instance Attribute Details
#selection ⇒ Array<Entity> (readonly)
9 10 11 |
# File 'lib/gamefic/scanner/base.rb', line 9 def selection @selection end |
#token ⇒ String (readonly)
12 13 14 |
# File 'lib/gamefic/scanner/base.rb', line 12 def token @token end |
Class Method Details
.scan(selection, token) ⇒ Result
29 30 31 |
# File 'lib/gamefic/scanner/base.rb', line 29 def self.scan selection, token new(selection, token).scan end |