lib/sniffer/config.rb in sniffer-0.1.0 vs lib/sniffer/config.rb in sniffer-0.2.0
- old
+ new
@@ -19,7 +19,20 @@
response_body: true,
timing: true
},
store: true,
enabled: false
+
+ def capacity?
+ store.is_a?(Hash) && store.key?(:capacity)
+ end
+
+ def capacity
+ store.fetch(:capacity).to_i
+ end
+
+ def rotate?
+ return false unless capacity?
+ store.fetch(:rotate, true)
+ end
end
end