lib/grape/router/route.rb in grape-1.0.1 vs lib/grape/router/route.rb in grape-1.0.2
- old
+ new
@@ -6,11 +6,11 @@
module Grape
class Router
class Route
ROUTE_ATTRIBUTE_REGEXP = /route_([_a-zA-Z]\w*)/
SOURCE_LOCATION_REGEXP = /^(.*?):(\d+?)(?::in `.+?')?$/
- FIXED_NAMED_CAPTURES = %w(format version).freeze
+ FIXED_NAMED_CAPTURES = %w[format version].freeze
attr_accessor :pattern, :translator, :app, :index, :regexp, :options
alias attributes translator
@@ -30,22 +30,22 @@
def respond_to_missing?(method_id, _)
ROUTE_ATTRIBUTE_REGEXP.match(method_id.to_s)
end
- [
- :prefix,
- :version,
- :settings,
- :format,
- :description,
- :http_codes,
- :headers,
- :entity,
- :details,
- :requirements,
- :request_method,
- :namespace
+ %i[
+ prefix
+ version
+ settings
+ format
+ description
+ http_codes
+ headers
+ entity
+ details
+ requirements
+ request_method
+ namespace
].each do |method_name|
define_method method_name do
attributes.public_send method_name
end
end