From 9edb8f9c414d0f79887d830a16028c92cd7a952e Mon Sep 17 00:00:00 2001 From: namusyaka Date: Sun, 10 Apr 2016 07:12:38 +0900 Subject: [PATCH] Expose Route#options --- lib/grape/router/route.rb | 2 +- spec/grape/api_spec.rb | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/grape/router/route.rb b/lib/grape/router/route.rb index 4d5bea4455..351b6c79b0 100644 --- a/lib/grape/router/route.rb +++ b/lib/grape/router/route.rb @@ -10,7 +10,7 @@ class Route SOURCE_LOCATION_REGEXP = /^(.*?):(\d+?)(?::in `.+?')?$/.freeze FIXED_NAMED_CAPTURES = %w(format version).freeze - attr_accessor :pattern, :translator, :app, :index, :regexp + attr_accessor :pattern, :translator, :app, :index, :regexp, :options alias_method :attributes, :translator diff --git a/spec/grape/api_spec.rb b/spec/grape/api_spec.rb index b293953018..83301936ca 100644 --- a/spec/grape/api_spec.rb +++ b/spec/grape/api_spec.rb @@ -2256,6 +2256,7 @@ def static expect(route.description).to eq('first method') expect(route.route_foo).to be_nil expect(route.params).to eq({}) + expect(route.options).to be_a_kind_of(Hash) end it 'has params which does not include format and version as named captures' do subject.version :v1, using: :path