Class: Gamefic::Query::Matches
Instance Attribute Summary collapse
-
#matching ⇒ String
readonly
The matching string.
-
#objects ⇒ Array<Object>
readonly
The resolved tokens.
-
#remaining ⇒ String
readonly
The remaining (unmatched) string.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(objects, matching, remaining) ⇒ Matches
constructor
A new instance of Matches.
Constructor Details
#initialize(objects, matching, remaining) ⇒ Matches
Returns a new instance of Matches.
16 17 18 19 20 |
# File 'lib/gamefic/query/matches.rb', line 16 def initialize objects, matching, remaining @objects = objects @matching = matching @remaining = remaining end |
Instance Attribute Details
#matching ⇒ String (readonly)
The matching string
10 11 12 |
# File 'lib/gamefic/query/matches.rb', line 10 def matching @matching end |
#objects ⇒ Array<Object> (readonly)
The resolved tokens
6 7 8 |
# File 'lib/gamefic/query/matches.rb', line 6 def objects @objects end |
#remaining ⇒ String (readonly)
The remaining (unmatched) string
14 15 16 |
# File 'lib/gamefic/query/matches.rb', line 14 def remaining @remaining end |
Class Method Details
.execute(objects, description, continued: false) ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/gamefic/query/matches.rb', line 22 def self.execute objects, description, continued: false if continued match_with_remainder objects, description else match_without_remainder objects, description end end |