From 6aafb733898ddff60dd2c479d332bc6d838faa84 Mon Sep 17 00:00:00 2001 From: Corey Johnson & Nathan Sobo Date: Mon, 17 Dec 2012 16:04:57 -0800 Subject: [PATCH] Add `get` and `set` to config --- src/app/config.coffee | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/app/config.coffee b/src/app/config.coffee index 15d014750..0b1c3fd69 100644 --- a/src/app/config.coffee +++ b/src/app/config.coffee @@ -87,6 +87,12 @@ class Config hash = hash[key] hash[keyPath.shift()] = value + get: (keyPathString) -> + @valueAtKeyPath(keyPathString.split(".")) + + set: (keyPathString, value) -> + @setValueAtKeyPath(keyPathString.split("."), value) + observe: (keyPathString, callback) -> keyPath = keyPathString.split('.') value = @valueAtKeyPath(keyPath)