From 57c266dfc8eb10b9bdadd10ac64366c5987919e7 Mon Sep 17 00:00:00 2001 From: Matthias Beyer Date: Sun, 22 Jan 2017 18:33:56 +0100 Subject: [PATCH] Add Ruby-like hash read/set syntax --- libimagruby/src/entry.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libimagruby/src/entry.rs b/libimagruby/src/entry.rs index 83ae868f..4614feab 100644 --- a/libimagruby/src/entry.rs +++ b/libimagruby/src/entry.rs @@ -268,7 +268,9 @@ pub fn setup_entryheader() -> Class { class.define(|itself| { itself.def("insert", r_entry_header_insert); itself.def("set" , r_entry_header_set); + itself.def("[]=" , r_entry_header_set); itself.def("read" , r_entry_header_get); + itself.def("[]" , r_entry_header_get); }); class }