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
39 40 41 42 43 |
# File 'lib/fitting/records/realized_unit.rb', line 39 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 |
# File 'lib/fitting/records/realized_unit.rb', line 11 def fully_covered? all_good_documented = false all_good_response_documented = false all_good_response_json_schemas = false all_good_valid_json_schemas = false test_file_paths.each do |_key, requests| all_good_documented = requests.all?(&:documented?) all_good_response_documented = requests.all?(&:response_documented?) all_good_response_json_schemas = requests.all?(&:response_json_schemas?) all_good_valid_json_schemas = requests.all?(&:valid_json_schemas?) end all_good_documented && all_good_response_documented && all_good_response_json_schemas && all_good_valid_json_schemas end |
#test_file_paths ⇒ Object
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/fitting/records/realized_unit.rb', line 28 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 |