Class: Array

Inherits:
Object
  • Object
show all
Defined in:
lib/kolekti/runner.rb

Overview

SPB runs on CentOS 7, which uses ruby 2.0.0-p598. On that version the Array class does not have the to_h method. The code below is a fix for that and should be removed when CentOS updates its ruby version. Version 2.1.0 already has Array#to_h built-in.

Instance Method Summary collapse

Instance Method Details

#to_hObject



7
8
9
10
11
12
13
# File 'lib/kolekti/runner.rb', line 7

def to_h
  result_hash = {}
  self.each do |code, metric_configuration|
    result_hash[code] = metric_configuration
  end
  return result_hash
end