Module: FnordMetric::GaugeValidations

Included in:
Gauge
Defined in:
lib/fnordmetric/gauge_validations.rb

Instance Method Summary collapse

Instance Method Details

#validate_series!Object



3
4
5
6
7
8
9
10
11
12
13
# File 'lib/fnordmetric/gauge_validations.rb', line 3

def validate_series!
  if !@opts[:series].is_a?(Array) || @opts[:series].size == 0
    raise "#{@opts[:key]}: missing option series"
  end

  if @opts[:series].size != @opts[:series].uniq.size
    raise "#{@opts[:key]}: series are not unique"
  end

  @opts[:series] = @opts[:series].map(&:to_sym)
end