Class: Textus::Protocol::Handlers::QueryContext
- Inherits:
-
Object
- Object
- Textus::Protocol::Handlers::QueryContext
- Defined in:
- lib/textus/protocol/handlers/query_context.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#call ⇒ Object
readonly
Returns the value of attribute call.
-
#container ⇒ Object
readonly
Returns the value of attribute container.
-
#store_engine ⇒ Object
readonly
Returns the value of attribute store_engine.
Instance Method Summary collapse
- #cursor_store ⇒ Object
- #entry_index ⇒ Object
- #etag_for(key) ⇒ Object
- #exists?(key:) ⇒ Boolean
-
#file_exists?(key) ⇒ Boolean
Narrow file queries (avoid raw file_system access).
-
#initialize(store_engine, container, call) ⇒ QueryContext
constructor
A new instance of QueryContext.
- #layout ⇒ Object
- #link_store ⇒ Object
- #list ⇒ Object
-
#manifest ⇒ Object
Container metadata (read-only).
- #mentry_for(key:) ⇒ Object
-
#read(key:) ⇒ Object
StoreEngine delegation (read side).
- #resolve(key:) ⇒ Object
- #schemas ⇒ Object
Constructor Details
#initialize(store_engine, container, call) ⇒ QueryContext
Returns a new instance of QueryContext.
5 6 7 8 9 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 5 def initialize(store_engine, container, call) @store_engine = store_engine @container = container @call = call end |
Instance Attribute Details
#call ⇒ Object (readonly)
Returns the value of attribute call.
11 12 13 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 11 def call @call end |
#container ⇒ Object (readonly)
Returns the value of attribute container.
11 12 13 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 11 def container @container end |
#store_engine ⇒ Object (readonly)
Returns the value of attribute store_engine.
11 12 13 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 11 def store_engine @store_engine end |
Instance Method Details
#cursor_store ⇒ Object
37 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 37 def cursor_store = @container.store.cursor_store |
#entry_index ⇒ Object
36 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 36 def entry_index = @container.store.entry_index |
#etag_for(key) ⇒ Object
26 27 28 29 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 26 def etag_for(key) path = @store_engine.resolve(key:).path @store_engine.file_system.etag(path) if @store_engine.file_system.exists?(path) end |
#exists?(key:) ⇒ Boolean
17 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 17 def exists?(key:) = @store_engine.exists?(key:) |
#file_exists?(key) ⇒ Boolean
Narrow file queries (avoid raw file_system access)
21 22 23 24 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 21 def file_exists?(key) path = @store_engine.resolve(key:).path @store_engine.file_system.exists?(path) end |
#layout ⇒ Object
34 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 34 def layout = @container.layout |
#link_store ⇒ Object
35 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 35 def link_store = @container.store.link_store |
#list ⇒ Object
16 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 16 def list(...) = @store_engine.list(...) |
#manifest ⇒ Object
Container metadata (read-only)
32 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 32 def manifest = @container.manifest |
#mentry_for(key:) ⇒ Object
18 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 18 def mentry_for(key:) = @store_engine.mentry_for(key:) |
#read(key:) ⇒ Object
StoreEngine delegation (read side)
14 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 14 def read(key:) = @store_engine.read(key:) |
#resolve(key:) ⇒ Object
15 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 15 def resolve(key:) = @store_engine.resolve(key:) |
#schemas ⇒ Object
33 |
# File 'lib/textus/protocol/handlers/query_context.rb', line 33 def schemas = @container.schemas |