Class: KrakendOpenAPI::ImportCommand
- Inherits:
-
Object
- Object
- KrakendOpenAPI::ImportCommand
- Defined in:
- lib/commands/import.rb
Overview
Import Command
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(spec:, config:) ⇒ ImportCommand
constructor
A new instance of ImportCommand.
Constructor Details
#initialize(spec:, config:) ⇒ ImportCommand
Returns a new instance of ImportCommand.
13 14 15 16 |
# File 'lib/commands/import.rb', line 13 def initialize(spec:, config:) @spec = spec @importer_config = config ? YamlReader.new(config).read : {} end |
Instance Method Details
#execute ⇒ Object
18 19 20 21 22 |
# File 'lib/commands/import.rb', line 18 def execute paths = OA3Reader.new(@spec).paths endpoints = OA3ToKrakendTransformer.new(paths, @importer_config).transform_paths KrakendWriter.new(endpoints, @importer_config).write end |