Sha256: b1c1f9888a25df835f5c53d91d421b20e68844e9aaec050dd5e8d8d3b02b2f79

Contents?: true

Size: 586 Bytes

Versions: 3

Compression:

Stored size: 586 Bytes

Contents

class Gamefic::Query::Available < Gamefic::Query::Base
  def context_from(subject)
    result = []
    top = subject.room || subject.parent
    unless top.nil?
      result.concat subquery_accessible(top)
    end
    result.delete subject
    subject.children.each do |c|
      result.push c
      result.concat subquery_accessible(c)
    end
    result
  end
end

class Gamefic::Query::Room < Gamefic::Query::Base
  def context_from(subject)
    subject.room ? [subject.room] : []
  end
end

Gamefic.script do
  set_default_query Gamefic::Query::Available
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gamefic-standard-2.4.0 lib/gamefic-standard/queries.rb
gamefic-standard-2.3.1 lib/gamefic-standard/queries.rb
gamefic-standard-2.3.0 lib/gamefic-standard/queries.rb