create Label#join method for easily joining Labels

This commit is contained in:
2011-03-14 11:10:24 +00:00
parent d560a7deff
commit d4cd5402bc
2 changed files with 18 additions and 0 deletions

View File

@@ -11,6 +11,11 @@ module Redistat
self.new(name, opts).save
end
def self.join(*args)
args = args.map {|i| i.to_s}
self.new(args.reject {|i| i.blank? }.join(GROUP_SEPARATOR))
end
def initialize(str, opts = {})
parse_options(opts)
@raw = str.to_s