Skip to content

Commit 9edb8f9

Browse files
committed
Expose Route#options
1 parent f075b61 commit 9edb8f9

2 files changed

Lines changed: 2 additions & 1 deletion

File tree

lib/grape/router/route.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ class Route
1010
SOURCE_LOCATION_REGEXP = /^(.*?):(\d+?)(?::in `.+?')?$/.freeze
1111
FIXED_NAMED_CAPTURES = %w(format version).freeze
1212

13-
attr_accessor :pattern, :translator, :app, :index, :regexp
13+
attr_accessor :pattern, :translator, :app, :index, :regexp, :options
1414

1515
alias_method :attributes, :translator
1616

spec/grape/api_spec.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2256,6 +2256,7 @@ def static
22562256
expect(route.description).to eq('first method')
22572257
expect(route.route_foo).to be_nil
22582258
expect(route.params).to eq({})
2259+
expect(route.options).to be_a_kind_of(Hash)
22592260
end
22602261
it 'has params which does not include format and version as named captures' do
22612262
subject.version :v1, using: :path

0 commit comments

Comments
 (0)