This cop checks for nested ternary op expressions.
# File lib/rubocop/cop/style/nested_ternary_operator.rb, line 10 def on_if(node) loc = node.loc # discard non-ternary ops return unless loc.respond_to?(:question) node.children.each do |child| on_node(:if, child) do |c| add_offense(c, :expression) if c.loc.respond_to?(:question) end end end
Generated with the Darkfish Rdoc Generator 2.