Sha256: 0cb662fb0b375b0f1ae025556af03275220ffaffb6335716cdcfea6c0d8ebe39

Contents?: true

Size: 737 Bytes

Versions: 16

Compression:

Stored size: 737 Bytes

Contents

module ThreeScaleToolbox
  module Commands
    module ImportCommand
      module OpenAPI
        module Method
          def method
            {
              'friendly_name' => friendly_name,
              'description' => description,
              'system_name' => system_name
            }
          end

          def friendly_name
            operation[:operationId] || operation_id
          end

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

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

          def description
            String(operation[:description])
          end
        end
      end
    end
  end
end

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
3scale_toolbox-0.19.3 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.19.2 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.19.1 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.19.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.18.3 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.18.2 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.18.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.17.1 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.17.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.16.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.15.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.14.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.13.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.12.4 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.12.3 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.12.2 lib/3scale_toolbox/commands/import_command/openapi/method.rb