From be3c95cf75c683de84446abdd832c948d2d001f0 Mon Sep 17 00:00:00 2001 From: git Date: Wed, 28 Jul 2010 09:17:59 -0400 Subject: [PATCH] TaggableString#initialize --- lib/benelux/stats.rb | 2 +- lib/selectable.rb | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/benelux/stats.rb b/lib/benelux/stats.rb index 5dd0023..43faf55 100644 --- a/lib/benelux/stats.rb +++ b/lib/benelux/stats.rb @@ -155,7 +155,7 @@ def samples(*args) args.flatten.each { |s| sample(s) } end - def merge!(other) + def merge!(other) return self if other.n == 0 if @n == 0 @min, @max = other.min, other.max diff --git a/lib/selectable.rb b/lib/selectable.rb index daa5321..1e8422b 100644 --- a/lib/selectable.rb +++ b/lib/selectable.rb @@ -87,4 +87,8 @@ class SelectableHash < Hash class TaggableString < String include Selectable::Object + def initialize(str, tags={}) + super(str) + add_tags tags unless tags.empty? + end end