Sha256: dcee6b868e2ef96b81f47d08256a42ac5f281dc5849dc74f0271e3159e018dad

Contents?: true

Size: 501 Bytes

Versions: 8

Compression:

Stored size: 501 Bytes

Contents

module Grape
  # A compiled route for inspection.
  class Route
    def initialize(options = {})
      @options = options || {}
    end

    def method_missing(method_id, *arguments)
      match = /route_([_a-zA-Z]\w*)/.match(method_id.to_s)
      if match
        @options[match.captures.last.to_sym]
      else
        super
      end
    end

    def to_s
      "version=#{route_version}, method=#{route_method}, path=#{route_path}"
    end

    private

    def to_ary
      nil
    end
  end
end

Version data entries

8 entries across 8 versions & 2 rubygems

Version Path
grape-security-0.8.0 lib/grape/route.rb
grape-0.12.0 lib/grape/route.rb
grape-0.11.0 lib/grape/route.rb
grape-0.10.1 lib/grape/route.rb
grape-0.10.0 lib/grape/route.rb
grape-0.9.0 lib/grape/route.rb
grape-0.8.0 lib/grape/route.rb
grape-0.7.0 lib/grape/route.rb