class RuboCop::AST::IfNode

def nested_conditional?

Returns:
  • (Boolean) - whether the `if` node contains nested conditionals

Other tags:
    Note: - This performs a shallow search.
def nested_conditional?
  node_parts[1..2].compact.each do |branch|
    branch.each_node(:if) do |nested|
      return true unless nested.elsif?
    end
  end
  false
end