Class: Textus::Handlers::Read::UidEntry
- Inherits:
-
Object
- Object
- Textus::Handlers::Read::UidEntry
- Defined in:
- lib/textus/handlers/read/uid_entry.rb
Instance Method Summary collapse
- #call(command, _call) ⇒ Object
-
#initialize(container:) ⇒ UidEntry
constructor
A new instance of UidEntry.
Constructor Details
#initialize(container:) ⇒ UidEntry
Returns a new instance of UidEntry.
5 6 7 |
# File 'lib/textus/handlers/read/uid_entry.rb', line 5 def initialize(container:) @container = container end |
Instance Method Details
#call(command, _call) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/textus/handlers/read/uid_entry.rb', line 9 def call(command, _call) envelope = Store::Entry::Reader.from(container: @container).read(command.key) return Value::Result.failure(:not_found, "no entry at #{command.key}") unless envelope Value::Result.success(envelope.uid) end |