Class: RSpec::OpenAPI::SchemaFile
- Inherits:
-
Object
- Object
- RSpec::OpenAPI::SchemaFile
- Defined in:
- lib/rspec/openapi/schema_file.rb
Overview
TODO: Support JSON
Instance Method Summary collapse
- #edit(&block) ⇒ Object
-
#initialize(path) ⇒ SchemaFile
constructor
A new instance of SchemaFile.
Constructor Details
#initialize(path) ⇒ SchemaFile
13 14 15 |
# File 'lib/rspec/openapi/schema_file.rb', line 13 def initialize(path) @path = path end |
Instance Method Details
#edit(&block) ⇒ Object
17 18 19 20 21 22 |
# File 'lib/rspec/openapi/schema_file.rb', line 17 def edit(&block) spec = read block.call(spec) ensure write(RSpec::OpenAPI::KeyTransformer.stringify(spec)) end |