diff --git a/lib/redistat/key.rb b/lib/redistat/key.rb index 9c7d5ac..3d741c1 100644 --- a/lib/redistat/key.rb +++ b/lib/redistat/key.rb @@ -30,7 +30,7 @@ module Redistat def to_s(depth = nil) depth ||= @options[:depth] if !@options[:depth].nil? key = "#{@scope}" - key << "/" + ((@options[:hash_label].nil? || @options[:hash_label] == true) ? @label.hash : @label.name) if !label.nil? + key << "/" + ((@options[:label_hash].nil? || @options[:label_hash] == true) ? @label.hash : @label.name) if !label.nil? key << ":#{@date.to_s(depth)}" end diff --git a/spec/key_spec.rb b/spec/key_spec.rb index a858f29..8f51c85 100644 --- a/spec/key_spec.rb +++ b/spec/key_spec.rb @@ -28,10 +28,10 @@ describe Redistat::Key do end it "should abide to hash_label option" do - @key = Redistat::Key.new(@scope, @label, @date, {:depth => :day, :hash_label => true}) + @key = Redistat::Key.new(@scope, @label, @date, {:depth => :day, :label_hash => true}) @key.to_s.should == "#{@scope}/#{@label_hash}:#{@key.date.to_s(:day)}" - @key = Redistat::Key.new(@scope, @label, @date, {:depth => :day, :hash_label => false}) + @key = Redistat::Key.new(@scope, @label, @date, {:depth => :day, :label_hash => false}) @key.to_s.should == "#{@scope}/#{@label}:#{@key.date.to_s(:day)}" end