Class: Textus::Handlers::Write::PutEntry
- Inherits:
-
Object
- Object
- Textus::Handlers::Write::PutEntry
- Defined in:
- lib/textus/handlers/write/put_entry.rb
Instance Method Summary collapse
- #call(command, call) ⇒ Object
-
#initialize(container:) ⇒ PutEntry
constructor
A new instance of PutEntry.
Constructor Details
#initialize(container:) ⇒ PutEntry
Returns a new instance of PutEntry.
5 6 7 |
# File 'lib/textus/handlers/write/put_entry.rb', line 5 def initialize(container:) @container = container end |
Instance Method Details
#call(command, call) ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/textus/handlers/write/put_entry.rb', line 9 def call(command, call) Textus::Manifest::Data.validate_key!(command.key) mentry = @container.manifest.resolver.resolve(command.key).entry writer = Store::Entry::Writer.from(container: @container, call: call) envelope = writer.put( command.key, mentry: mentry, payload: Textus::Value::Payload.new( meta: command., body: command.body, content: command.content, ), if_etag: command.if_etag, ) Value::Result.success(envelope) end |