Class: OpenapiContracts::Coverage
- Inherits:
-
Object
- Object
- OpenapiContracts::Coverage
- Defined in:
- lib/openapi_contracts/coverage.rb,
lib/openapi_contracts/coverage/store.rb,
lib/openapi_contracts/coverage/report.rb more...
Defined Under Namespace
Instance Attribute Summary collapse
-
#store ⇒ Object
readonly
Returns the value of attribute store.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(doc) ⇒ Coverage
constructor
A new instance of Coverage.
- #report ⇒ Object
Constructor Details
permalink #initialize(doc) ⇒ Coverage
Returns a new instance of Coverage.
13 14 15 16 |
# File 'lib/openapi_contracts/coverage.rb', line 13 def initialize(doc) @store = Store.new @doc = doc end |
Instance Attribute Details
permalink #store ⇒ Object (readonly)
Returns the value of attribute store.
11 12 13 |
# File 'lib/openapi_contracts/coverage.rb', line 11 def store @store end |
Class Method Details
permalink .merge_reports(doc, *others) ⇒ Object
[View source]
6 7 8 9 |
# File 'lib/openapi_contracts/coverage.rb', line 6 def self.merge_reports(doc, *others) reports = others.map { |fp| JSON(File.read(fp))['paths'] } Report.merge(doc, *reports) end |
Instance Method Details
permalink #report ⇒ Object
[View source]
20 21 22 |
# File 'lib/openapi_contracts/coverage.rb', line 20 def report Report.new(@doc, store.data) end |