Class: OpenapiSdkGenerator::Parser

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file_path) ⇒ Parser



9
10
11
12
13
14
15
16
# File 'lib/openapi_sdk_generator/parser.rb', line 9

def initialize(file_path)
  @file_path = file_path
  @spec = load_spec
  @endpoints = []
  @models = {}
  @api_info = {}
  parse_spec
end

Instance Attribute Details

#api_infoObject (readonly)

Returns the value of attribute api_info.



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

def api_info
  @api_info
end

#base_urlObject (readonly)

Returns the value of attribute base_url.



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

def base_url
  @base_url
end

#endpointsObject (readonly)

Returns the value of attribute endpoints.



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

def endpoints
  @endpoints
end

#modelsObject (readonly)

Returns the value of attribute models.



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

def models
  @models
end

#specObject (readonly)

Returns the value of attribute spec.



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

def spec
  @spec
end

Instance Method Details

#api_descriptionObject



26
27
28
# File 'lib/openapi_sdk_generator/parser.rb', line 26

def api_description
  @api_info[:description]
end

#api_titleObject



18
19
20
# File 'lib/openapi_sdk_generator/parser.rb', line 18

def api_title
  @api_info[:title]
end

#api_versionObject



22
23
24
# File 'lib/openapi_sdk_generator/parser.rb', line 22

def api_version
  @api_info[:version]
end