From kolekti_analizo (https://github.com/mezuro/kolekti_analizo/blob/master/lib/kolekti_analizo/collector.rb#L25) we have:
metric = !metric_configuration.nil? ? metric_configuration.metric : nil
if metric.nil? || metric.type != 'NativeMetricSnapshot' || metric.metric_collector_name != self.name
raise ArgumentError.new("Metric configuration does not belong to Analizo")
end
This logic will be repeated through other uses like MetricFu.
We can extract it into a new method, use it inside default_value_from and preserve the raise.
From kolekti_analizo (https://github.com/mezuro/kolekti_analizo/blob/master/lib/kolekti_analizo/collector.rb#L25) we have:
This logic will be repeated through other uses like MetricFu.
We can extract it into a new method, use it inside
default_value_fromand preserve the raise.