Sha256: b6c428fe82223c08b5f90dfd98ba565204669c521443b903f670e10e29bd7c8d

Contents?: true

Size: 488 Bytes

Versions: 1

Compression:

Stored size: 488 Bytes

Contents

module Grape
  class Namespace
    attr_reader :space, :options

    # options:
    #   requirements: a hash
    def initialize(space, options = {})
      @space = space.to_s
      @options = options
    end

    def requirements
      options[:requirements] || {}
    end

    def self.joined_space(settings)
      (settings || []).map(&:space).join('/')
    end

    def self.joined_space_path(settings)
      Rack::Mount::Utils.normalize_path(joined_space(settings))
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
grape-0.12.0 lib/grape/namespace.rb