Skip to content

Commit

Permalink
Expose Route#options
Browse files Browse the repository at this point in the history
  • Loading branch information
namusyaka committed Apr 9, 2016
1 parent f075b61 commit 9edb8f9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/grape/router/route.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions spec/grape/api_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 9edb8f9

Please sign in to comment.