vendor/bundle/ruby/2.3.0/gems/sqreen-1.10.5/lib/sqreen/metrics_store.rb
# When a metric is not yet created
When a metric is not yet created
When a metric is not yet created
def valid_metric(kind, name)
      unless Sqreen::Metric.const_defined?(kind)
        raise UnknownMetric, "No such #{kind} metric"
      end
      klass = Sqreen::Metric.const_get(kind)
      metric = @metrics[name] && @metrics[name][0]
      if metric && metric.class != klass
        msg = "Was a #{metric.class.name} not a #{klass.name} "
        raise AlreadyRegisteredMetric, msg
      end
      klass
    end
def valid_metric ( kind , name ) unless Sqreen :: Metric . const_defined? ( kind ) raise UnknownMetric , "No such #{kind} metric" end klass = Sqreen :: Metric . const_get ( kind ) metric = @metrics [ name ] && @metrics [ name ] [ 0 ] if metric && metric . class != klass msg = "Was a #{metric.class.name} not a #{klass.name} " raise AlreadyRegisteredMetric , msg end klass end
When a metric is not yet created
When a metric is not yet created
kind
<not_specific>
name
<not_specific>