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

Returns a new instance of SchemaFile.

Parameters:

  • path (String)


7
8
9
# File 'lib/rspec/openapi/schema_file.rb', line 7

def initialize(path)
  @path = path
end

Instance Method Details

#edit(&block) ⇒ Object



11
12
13
14
15
16
# File 'lib/rspec/openapi/schema_file.rb', line 11

def edit(&block)
  spec = read
  block.call(spec)
ensure
  write(spec)
end