Sha256: 9718b0fb8ea0344e444b3d65058d0f9eadb5d1319dc95e6bf9a34ff15e1c90ff

Contents?: true

Size: 738 Bytes

Versions: 3

Compression:

Stored size: 738 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[:operation_id] || 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

3 entries across 3 versions & 1 rubygems

Version Path
3scale_toolbox-1.0.1 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-1.0.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb
3scale_toolbox-0.20.0 lib/3scale_toolbox/commands/import_command/openapi/method.rb