class Statsby::TagSet

A set of tags is really just some key value pairs, so we can leverage Ruby's built-in Hash class, simply overriding `#to_s` to get the format that we need. Maybe we can add some validation in the future.

Public Class Methods

from_hash(hash) click to toggle source
# File lib/statsby/tag_set.rb, line 7
def self.from_hash(hash)
  TagSet.new.merge(hash)
end

Public Instance Methods

to_s() click to toggle source
# File lib/statsby/tag_set.rb, line 11
def to_s
  map { |key, value| "#{key}=#{value}" }.join(',')
end