Class: Fitting::Records::Spherical::Requests

Inherits:
Object
  • Object
show all
Defined in:
lib/fitting/records/spherical/requests.rb

Instance Method Summary collapse

Instance Method Details

#to_aObject



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/fitting/records/spherical/requests.rb', line 8

def to_a
  return @to_a if @to_a

  array = []
  Dir['fitting_tests/*.json'].each do |file|
    array += JSON.load(File.read(file))
  end
  @to_a = array.inject([]) do |res, tested_request|
    res.push(Fitting::Records::Spherical::Request.load(tested_request))
  end
end