Sha256: 084be4f0068b8881109cc3781b0765589a24bae494a870f1b8d20a852a20aac4

Contents?: true

Size: 504 Bytes

Versions: 1

Compression:

Stored size: 504 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

1 entries across 1 versions & 1 rubygems

Version Path
grape-0.6.1 lib/grape/route.rb