Class: OpenapiContracts::Doc::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi_contracts/doc/parser.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(rootfile) ⇒ Parser

Returns a new instance of Parser.



7
8
9
# File 'lib/openapi_contracts/doc/parser.rb', line 7

def initialize(rootfile)
  @rootfile = rootfile
end

Class Method Details

.call(dir, filename) ⇒ Object



3
4
5
# File 'lib/openapi_contracts/doc/parser.rb', line 3

def self.call(dir, filename)
  new(dir.join(filename)).parse
end

Instance Method Details

#parseObject



11
12
13
14
15
16
17
# File 'lib/openapi_contracts/doc/parser.rb', line 11

def parse
  file = Doc::FileParser.parse(@rootfile, @rootfile)
  data = file.data
  data.deep_merge! merge_components
  nullable_to_type!(data)
  # debugger
end