From 6875376f91c22fc5d1ecbde4fdafcddb7f904eb9 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sat, 21 Jan 2017 19:55:50 +0100 Subject: [PATCH] Impl Store::update() interface function --- libimagruby/src/store.rs | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/libimagruby/src/store.rs b/libimagruby/src/store.rs index 8d5d19a1..faeabad6 100644 --- a/libimagruby/src/store.rs +++ b/libimagruby/src/store.rs @@ -198,7 +198,20 @@ methods!( // On error: Nil + Exception // fn update(fle: RFileLockEntry) -> NilClass { - unimplemented!() + let fle = typecheck!(fle).unwrap().clone(); + + call_on_store! { + store <- itself wrapped inside STORE_WRAPPER, + real_fle <- fetch fle, + operation { + if let Err(e) = store.update(real_fle) { + trace_error(&e); + VM::raise(Class::from_existing("RuntimeError"), e.description()); + } + NilClass::new() + }, + on fail return NilClass::new() + } } // Delete a FileLockEntry from the store