Parent

Methods

Files

Class/Module Index [+]

Quicksearch

RuboCop::Cop::Style::EmptyLineBetweenDefs

This cop checks whether method definitions are separated by empty lines.

Constants

MSG

Public Instance Methods

on_def(node) click to toggle source
# File lib/rubocop/cop/style/empty_line_between_defs.rb, line 10
def on_def(node)
  if @prev_def_end && (def_start(node) - @prev_def_end) == 1
    unless @prev_was_single_line && singe_line_def?(node) &&
        cop_config['AllowAdjacentOneLineDefs']
      add_offense(node, :keyword)
    end
  end

  @prev_def_end = def_end(node)
  @prev_was_single_line = singe_line_def?(node)
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.