class OpenTSDBConsumer::Tags

Public Class Methods

new(tags = {}) click to toggle source
# File lib/opentsdb-consumer/tags.rb, line 3
def initialize(tags = {})
  merge!(tags)

  check_tags!
end

Public Instance Methods

to_s() click to toggle source
# File lib/opentsdb-consumer/tags.rb, line 9
def to_s
  map do |key, value|
    [key, value].join '='
  end.join(',')
end

Private Instance Methods

check_tags!() click to toggle source
# File lib/opentsdb-consumer/tags.rb, line 17
def check_tags!
  each do |key, value|
    raise EmptyTag if key && (value.nil? || value.to_s.empty?)
  end
end