class RuboCop::Cop::Style::EmptyLinesAroundBlockBody

This cops checks if empty lines around the bodies of blocks match the configuration.

@example

something do

  ...
end

Constants

KIND

Public Instance Methods

on_block(node) click to toggle source
# File lib/rubocop/cop/style/empty_lines_around_block_body.rb, line 21
def on_block(node)
  _send, _args, body = *node
  check(node, body)
end

Private Instance Methods

check(node, body) click to toggle source
# File lib/rubocop/cop/style/empty_lines_around_block_body.rb, line 28
def check(node, body)
  return unless body || style == :no_empty_lines

  start_line = node.loc.begin.line
  end_line = node.loc.end.line

  return if start_line == end_line

  check_source(start_line, end_line)
end