Class: Fitting::Records::RealizedUnit
- Inherits:
-
Object
- Object
- Fitting::Records::RealizedUnit
- Defined in:
- lib/fitting/records/realized_unit.rb
Instance Method Summary collapse
- #all_documented_requests ⇒ Object
- #fully_covered? ⇒ Boolean
-
#initialize(realized_requests, documented_requests) ⇒ RealizedUnit
constructor
A new instance of RealizedUnit.
- #test_file_paths ⇒ Object
- #white_unit ⇒ Object
Constructor Details
#initialize(realized_requests, documented_requests) ⇒ RealizedUnit
Returns a new instance of RealizedUnit.
6 7 8 9 |
# File 'lib/fitting/records/realized_unit.rb', line 6 def initialize(realized_requests, documented_requests) @realized_requests = realized_requests @documented_requests = documented_requests end |
Instance Method Details
#all_documented_requests ⇒ Object
41 42 43 44 45 |
# File 'lib/fitting/records/realized_unit.rb', line 41 def all_documented_requests @all_documented_requests ||= @documented_requests.to_a.inject([]) do |res, tomogram_request| res.push(Fitting::Records::Documented::Request.new(tomogram_request, nil)) end end |
#fully_covered? ⇒ Boolean
11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'lib/fitting/records/realized_unit.rb', line 11 def fully_covered? test_file_paths.each do |_key, requests| all_good = requests.all?(&:documented?) return false unless all_good end test_file_paths.each do |_key, requests| all_good = requests.all?(&:response_documented?) return false unless all_good end test_file_paths.each do |_key, requests| all_good = requests.all?(&:response_json_schemas?) return false unless all_good end test_file_paths.each do |_key, requests| all_good = requests.all?(&:valid_json_schemas?) return false unless all_good end true end |
#test_file_paths ⇒ Object
31 32 33 34 35 36 37 38 39 |
# File 'lib/fitting/records/realized_unit.rb', line 31 def test_file_paths return @test_file_paths if @test_file_paths @test_file_paths = {} white_unit.map do |request| @test_file_paths[request.test_file_path] ||= [] @test_file_paths[request.test_file_path].push(request) end @test_file_paths end |