Class: RuboCop::Cop::Grape::RouteParamGrouping
- Inherits:
-
Base
- Object
- Base
- RuboCop::Cop::Grape::RouteParamGrouping
- Includes:
- EndpointHelper
- Defined in:
- lib/rubocop/cop/grape/route_param_grouping.rb
Overview
Constant Summary collapse
- MSG =
'Use route_param for route parameter'
Instance Method Summary collapse
Instance Method Details
#on_block(node) ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/rubocop/cop/grape/route_param_grouping.rb', line 24 def on_block(node) return unless (method_send_node = http_method_node?(node)) return unless (first_argument_node = method_send_node.arguments.first) return unless first_argument_node.value.match?(/:\w/) add_offense(first_argument_node) end |