Class: OpenapiSdkGenerator::Parser
- Inherits:
-
Object
- Object
- OpenapiSdkGenerator::Parser
- Defined in:
- lib/openapi_sdk_generator/parser.rb
Instance Attribute Summary collapse
-
#api_info ⇒ Object
readonly
Returns the value of attribute api_info.
-
#base_url ⇒ Object
readonly
Returns the value of attribute base_url.
-
#endpoints ⇒ Object
readonly
Returns the value of attribute endpoints.
-
#models ⇒ Object
readonly
Returns the value of attribute models.
-
#spec ⇒ Object
readonly
Returns the value of attribute spec.
Instance Method Summary collapse
- #api_description ⇒ Object
- #api_title ⇒ Object
- #api_version ⇒ Object
-
#initialize(file_path) ⇒ Parser
constructor
A new instance of Parser.
Constructor Details
#initialize(file_path) ⇒ Parser
Returns a new instance of Parser.
5 6 7 8 9 10 11 12 |
# File 'lib/openapi_sdk_generator/parser.rb', line 5 def initialize(file_path) @file_path = file_path @spec = load_spec @endpoints = [] @models = {} @api_info = {} parse_spec end |
Instance Attribute Details
#api_info ⇒ Object (readonly)
Returns the value of attribute api_info.
3 4 5 |
# File 'lib/openapi_sdk_generator/parser.rb', line 3 def api_info @api_info end |
#base_url ⇒ Object (readonly)
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/openapi_sdk_generator/parser.rb', line 3 def base_url @base_url end |
#endpoints ⇒ Object (readonly)
Returns the value of attribute endpoints.
3 4 5 |
# File 'lib/openapi_sdk_generator/parser.rb', line 3 def endpoints @endpoints end |
#models ⇒ Object (readonly)
Returns the value of attribute models.
3 4 5 |
# File 'lib/openapi_sdk_generator/parser.rb', line 3 def models @models end |
#spec ⇒ Object (readonly)
Returns the value of attribute spec.
3 4 5 |
# File 'lib/openapi_sdk_generator/parser.rb', line 3 def spec @spec end |
Instance Method Details
#api_description ⇒ Object
22 23 24 |
# File 'lib/openapi_sdk_generator/parser.rb', line 22 def api_description @api_info[:description] || 'API client generated from OpenAPI specification' end |
#api_title ⇒ Object
14 15 16 |
# File 'lib/openapi_sdk_generator/parser.rb', line 14 def api_title @api_info[:title] || 'Generated API Client' end |
#api_version ⇒ Object
18 19 20 |
# File 'lib/openapi_sdk_generator/parser.rb', line 18 def api_version @api_info[:version] || '1.0.0' end |