Module: RuboCop::Cop::HashNode

Included in:
Style::AlignHash::AlignmentOfValues, Style::SpaceAroundOperators
Defined in:
lib/rubocop/cop/mixin/hash_node.rb

Overview

Common functionality for checking hash nodes.

Instance Method Summary collapse

Instance Method Details

#any_pairs_on_the_same_line?(node) ⇒ Boolean

Returns:

  • (Boolean)


7
8
9
10
11
# File 'lib/rubocop/cop/mixin/hash_node.rb', line 7

def any_pairs_on_the_same_line?(node)
  node.children.butfirst.any? do |pair|
    !Util.begins_its_line?(pair.loc.expression)
  end
end