Class: Gamefic::Query::General
- Defined in:
- lib/gamefic/query/general.rb
Overview
A General query accepts an array of entities to filter. Unlike Scoped queries, the resulting entities will not necessarily be in the actor’s immediate vicinity.
General queries can also be passed a Proc that returns an array of entities. If the Proc accepts an argument, it will be given the subject of the query.
Direct Known Subclasses
Instance Attribute Summary
Attributes inherited from Base
#ambiguous, #arguments, #narrative
Instance Method Summary collapse
-
#initialize(entities, *arguments, ambiguous: false, name: nil) ⇒ General
constructor
A new instance of General.
- #span(subject) ⇒ Object
Methods inherited from Base
#accept?, #ambiguous?, #inspect, #name, #precision, #query, #select
Constructor Details
#initialize(entities, *arguments, ambiguous: false, name: nil) ⇒ General
Returns a new instance of General.
17 18 19 20 |
# File 'lib/gamefic/query/general.rb', line 17 def initialize entities, *arguments, ambiguous: false, name: nil super(*arguments, ambiguous: ambiguous, name: name) @entities = entities end |
Instance Method Details
#span(subject) ⇒ Object
22 23 24 |
# File 'lib/gamefic/query/general.rb', line 22 def span subject available_entities(subject) end |