Class: RSpec::OpenAPI::SchemaFile

Inherits:
Object
  • Object
show all
Defined in:
lib/rspec/openapi/schema_file.rb

Overview

TODO: Support JSON

Instance Method Summary collapse

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