Class: Gamefic::Query::Matches

Inherits:
Object
  • Object
show all
Defined in:
lib/gamefic/query/matches.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

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

#matchingString (readonly)

The matching string

Returns:



10
11
12
# File 'lib/gamefic/query/matches.rb', line 10

def matching
  @matching
end

#objectsArray<Object> (readonly)

The resolved tokens

Returns:



6
7
8
# File 'lib/gamefic/query/matches.rb', line 6

def objects
  @objects
end

#remainingString (readonly)

The remaining (unmatched) string

Returns:



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