Sha256: e5511d851a228379db54f62a61ecd7388692c40c31a151565f4c1a139140fe18

Contents?: true

Size: 782 Bytes

Versions: 17

Compression:

Stored size: 782 Bytes

Contents

module Skylight
  module Normalizers
    module Grape
      class Endpoint < Normalizer
        %w[run render run_filters].each { |type| require "skylight/normalizers/grape/endpoint_#{type}" }

        require "skylight/normalizers/grape/format_response"

        private

        def get_method(endpoint)
          method = endpoint.options[:method].first
          method = "#{method}..." if endpoint.options[:method].length > 1
          method
        end

        def get_path(endpoint)
          endpoint.options[:path].join("/")
        end

        def get_namespace(endpoint)
          # slice off preceding slash for data continuity
          ::Grape::Namespace.joined_space_path(endpoint.namespace_stackable(:namespace)).to_s[1..]
        end
      end
    end
  end
end

Version data entries

17 entries across 17 versions & 1 rubygems

Version Path
skylight-6.1.0.beta lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.4 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.3 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.5 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.2 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.1 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.0 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.0.beta2 lib/skylight/normalizers/grape/endpoint.rb
skylight-6.0.0.beta lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.4 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.3 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.2 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.1 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.3.0 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.2.0 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.2.0.beta2 lib/skylight/normalizers/grape/endpoint.rb
skylight-5.2.0.beta lib/skylight/normalizers/grape/endpoint.rb