Commit 6eb96b20 authored by Pawel Chojnacki's avatar Pawel Chojnacki

Use `key?` instead of `has_key?`

parent dbb3c280
......@@ -14,14 +14,14 @@ module Gitlab
end
def metric_from_entry(entry)
missing_fields = [:title, :required_metrics, :weight, :queries].select { |key| !entry.has_key?(key) }
missing_fields = [:title, :required_metrics, :weight, :queries].select { |key| !entry.key?(key) }
raise ParsingError.new("entry missing required fields #{missing_fields}") unless missing_fields.empty?
Metric.new(entry[:title], entry[:required_metrics], entry[:weight], entry[:y_label], entry[:queries])
end
def group_from_entry(entry)
missing_fields = [:group, :priority, :metrics].select { |key| !entry.has_key?(key) }
missing_fields = [:group, :priority, :metrics].select { |key| !entry.key?(key) }
raise ParsingError.new("entry missing required fields #{missing_fields}") unless missing_fields.empty?
group = MetricGroup.new(entry[:group], entry[:priority])
......
......@@ -44,7 +44,7 @@ module Gitlab
def process_query(context, query)
query_with_result = query.dup
query_with_result[:result] =
if query.has_key?(:query_range)
if query.key?(:query_range)
client_query_range(query[:query_range] % context, start: context[:timeframe_start], stop: context[:timeframe_end])
else
client_query(query[:query] % context, time: context[:timeframe_end])
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment