Sha256: 8c398b39bac5269e9db1ccea8c3e702a6299d33a651a9c6f04c0d28a67a7ca87

Contents?: true

Size: 632 Bytes

Versions: 4

Compression:

Stored size: 632 Bytes

Contents

require 'fitting/records/spherical/request'
require 'json'

module Fitting
  class Records
    class Spherical
      class Requests
        def to_a
          return @to_a if @to_a

          array = []
          Dir['fitting_tests/*.json'].each do |file|
            array += JSON.parse(File.read(file))
          end
          @to_a = array.inject([]) do |res, tested_request|
            request = Fitting::Records::Spherical::Request.load(tested_request)
            next res unless request.path.to_s.start_with?(Fitting.configuration.prefix)

            res.push(request)
          end
        end
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
fitting-2.18.3 lib/fitting/records/spherical/requests.rb
fitting-2.18.2 lib/fitting/records/spherical/requests.rb
fitting-2.18.1 lib/fitting/records/spherical/requests.rb
fitting-2.18.0 lib/fitting/records/spherical/requests.rb