Class: Textus::Store::Compositor

Inherits:
Object
  • Object
show all
Defined in:
lib/textus/store/compositor.rb

Instance Method Summary collapse

Constructor Details

#initialize(container) ⇒ Compositor

Returns a new instance of Compositor.



6
7
8
# File 'lib/textus/store/compositor.rb', line 6

def initialize(container)
  @container = container
end

Instance Method Details

#delete(key, call:, mentry: nil, if_etag: nil) ⇒ Object



19
20
21
22
# File 'lib/textus/store/compositor.rb', line 19

def delete(key, call:, mentry: nil, if_etag: nil)
  Textus::Store::Envelope::Writer.from(container: @container, call: call)
                                 .delete(key, mentry: mentry, if_etag: if_etag)
end

#exists?(key) ⇒ Boolean

Returns:

  • (Boolean)


29
30
31
# File 'lib/textus/store/compositor.rb', line 29

def exists?(key)
  Textus::Store::Envelope::Reader.from(container: @container).exists?(key)
end

#move(from_key:, to_key:, new_mentry:, call:, if_etag: nil) ⇒ Object



24
25
26
27
# File 'lib/textus/store/compositor.rb', line 24

def move(from_key:, to_key:, new_mentry:, call:, if_etag: nil)
  Textus::Store::Envelope::Writer.from(container: @container, call: call)
                                 .move(from_key: from_key, to_key: to_key, new_mentry: new_mentry, if_etag: if_etag)
end

#read(key) ⇒ Object



15
16
17
# File 'lib/textus/store/compositor.rb', line 15

def read(key)
  Textus::Store::Envelope::Reader.from(container: @container).read(key)
end

#write(key, mentry:, payload:, call:, if_etag: nil) ⇒ Object



10
11
12
13
# File 'lib/textus/store/compositor.rb', line 10

def write(key, mentry:, payload:, call:, if_etag: nil)
  Textus::Store::Envelope::Writer.from(container: @container, call: call)
                                 .put(key, mentry: mentry, payload: payload, if_etag: if_etag)
end