Module: ThreeScaleToolbox::Commands::ImportCommand::OpenAPI::Method

Included in:
Operation
Defined in:
lib/3scale_toolbox/commands/import_command/openapi/method.rb

Instance Method Summary collapse

Instance Method Details

#descriptionObject



26
27
28
# File 'lib/3scale_toolbox/commands/import_command/openapi/method.rb', line 26

def description
  String(operation[:description])
end

#friendly_nameObject



14
15
16
# File 'lib/3scale_toolbox/commands/import_command/openapi/method.rb', line 14

def friendly_name
  operation[:operationId] || operation_id
end

#methodObject



6
7
8
9
10
11
12
# File 'lib/3scale_toolbox/commands/import_command/openapi/method.rb', line 6

def method
  {
    'friendly_name' => friendly_name,
    'description' => description,
    'system_name' => system_name
  }
end

#operation_idObject



22
23
24
# File 'lib/3scale_toolbox/commands/import_command/openapi/method.rb', line 22

def operation_id
  "#{operation[:verb]}#{operation[:path].gsub(/[^\w]/, '')}"
end

#system_nameObject



18
19
20
# File 'lib/3scale_toolbox/commands/import_command/openapi/method.rb', line 18

def system_name
  friendly_name.downcase.gsub(/[^\w]/, '_')
end