Class: OpenapiContracts::Doc::FileParser::Result

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#dataObject

Returns the value of attribute data



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

def data
  @data
end

#pathObject

Returns the value of attribute path



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

def path
  @path
end

Instance Method Details

#to_mergable_hashObject



4
5
6
7
8
9
10
# File 'lib/openapi_contracts/doc/file_parser.rb', line 4

def to_mergable_hash
  d = data
  path.ascend do |p|
    d = {p.basename.to_s => d}
  end
  d
end