summaryrefslogtreecommitdiff
path: root/ricky/param/option.py
diff options
context:
space:
mode:
Diffstat (limited to 'ricky/param/option.py')
-rw-r--r--ricky/param/option.py16
1 files changed, 16 insertions, 0 deletions
diff --git a/ricky/param/option.py b/ricky/param/option.py
new file mode 100644
index 0000000..0cbd505
--- /dev/null
+++ b/ricky/param/option.py
@@ -0,0 +1,16 @@
+"""
+Base option class...essentially a dictionary
+but attributes can be accessed with a dot
+"""
+
+
+class Option(dict):
+ def __init__(self, **kwargs):
+ super(Option, self).__init__(**kwargs)
+
+ def __getattr__(self, attr):
+ return self.get(attr)
+
+ __setattr__ = dict.__setitem__
+
+ __delattr__ = dict.__delitem__