lib/toxiproxy/toxic.rb in toxiproxy-0.0.2 vs lib/toxiproxy/toxic.rb in toxiproxy-0.1.0

- old
+ new

@@ -9,20 +9,24 @@ @direction = options[:direction] @attrs = options[:attrs] || {} end def enabled? - attrs[:enabled] + attrs['enabled'] end def enable - attrs[:enabled] = true + attrs['enabled'] = true save end def disable - attrs[:enabled] = false + attrs['enabled'] = false save + end + + def [](name) + attrs[name] end def []=(name, value) attrs[name] = value end