class Gamefic::Query::Family
Query
the subject’s ascendants, descendants, siblings, and siblings’ descendants.
Entities other than the subject’s parent and immediate children need to be ‘accessible` to be included in the query.
Public Instance Methods
Source
# File lib/gamefic/query/family.rb, line 14 def span(subject) Ascendants.span(subject) + Descendants.span(subject) + match_sibling_branches(subject) end
Private Instance Methods
Source
# File lib/gamefic/query/family.rb, line 20 def match_sibling_branches(subject) Siblings.span(subject).flat_map do |child| [child] + subquery_accessible(child) end end