Class: RuboCop::Cop::GitHub::RailsRenderInline

Inherits:
RuboCop::Cop
  • Object
show all
Defined in:
lib/rubocop/cop/github/rails_render_inline.rb

Constant Summary collapse

MSG =
"Avoid `render inline:`"

Instance Method Summary collapse

Instance Method Details

#on_send(node) ⇒ Object



19
20
21
22
23
24
25
# File 'lib/rubocop/cop/github/rails_render_inline.rb', line 19

def on_send(node)
  if option_pairs = render_with_options?(node)
    if option_pairs.detect { |pair| inline_key?(pair) }
      add_offense(node, :expression)
    end
  end
end