From fccf0db68a954c45c25bc5f6bd7fe5a3dafdefc8 Mon Sep 17 00:00:00 2001 From: Jim Myhrberg Date: Wed, 18 Apr 2012 12:33:19 +0100 Subject: [PATCH] Options are optional --- lib/redistat/summary.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/redistat/summary.rb b/lib/redistat/summary.rb index def7a84..b92224a 100644 --- a/lib/redistat/summary.rb +++ b/lib/redistat/summary.rb @@ -32,7 +32,7 @@ module Redistat update(*args) unless buffer.store(*args) end - def update(key, stats, depth_limit, opts) + def update(key, stats, depth_limit, opts = {}) if opts[:enable_grouping] stats = inject_group_summaries(stats) key.groups.each do |k| @@ -46,14 +46,14 @@ module Redistat private - def update_key(key, stats, depth_limit, opts) + def update_key(key, stats, depth_limit, opts = {}) Date::DEPTHS.each do |depth| update_fields(key, stats, depth, opts) break if depth == depth_limit end end - def update_fields(key, stats, depth, opts) + def update_fields(key, stats, depth, opts = {}) stats.each do |field, value| db(opts[:connection_ref]).hincrby key.to_s(depth), field, value end