Sha256: f70a9a61ac3c2ddce131e6799afa4464ea4782b29c071824730b8292d315f39f

Contents?: true

Size: 482 Bytes

Versions: 3

Compression:

Stored size: 482 Bytes

Contents

module Grape
  class Namespace
    attr_reader :space, :options

    # options:
    #   requirements: a hash
    def initialize(space, options = {})
      @space, @options = space.to_s, 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

3 entries across 3 versions & 1 rubygems

Version Path
grape-0.11.0 lib/grape/namespace.rb
grape-0.10.1 lib/grape/namespace.rb
grape-0.10.0 lib/grape/namespace.rb