Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::BracesAroundHashParameters

This cop checks for braces in method calls with hash parameters.

Public Instance Methods

on_send(node) click to toggle source
# File lib/rubocop/cop/style/braces_around_hash_parameters.rb, line 9
def on_send(node)
  _receiver, method_name, *args = *node

  # Discard attr writer methods.
  return if method_name.to_s.end_with?('=')
  # Discard operator methods.
  return if operator?(method_name)

  # We care only for the last argument.
  arg = args.last

  check(arg, args) if non_empty_hash?(arg)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.