Class: Textus::Protocol::Handlers::QueryContext

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/protocol/handlers/query_context.rb

Direct Known Subclasses

CommandContext

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#callObject (readonly)

Returns the value of attribute call.



11
12
13
# File 'lib/textus/protocol/handlers/query_context.rb', line 11

def call
  @call
end

#containerObject (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_engineObject (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_storeObject



37
# File 'lib/textus/protocol/handlers/query_context.rb', line 37

def cursor_store = @container.store.cursor_store

#entry_indexObject



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

Returns:

  • (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)

Returns:

  • (Boolean)


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

#layoutObject



34
# File 'lib/textus/protocol/handlers/query_context.rb', line 34

def layout       = @container.layout


35
# File 'lib/textus/protocol/handlers/query_context.rb', line 35

def link_store   = @container.store.link_store

#listObject



16
# File 'lib/textus/protocol/handlers/query_context.rb', line 16

def list(...)        = @store_engine.list(...)

#manifestObject

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:)

#schemasObject



33
# File 'lib/textus/protocol/handlers/query_context.rb', line 33

def schemas      = @container.schemas