Class: Rubocop::Cop::TrivialAccessors

Inherits:
Cop
  • Object
show all
Defined in:
lib/rubocop/cop/trivial_accessors.rb

Constant Summary collapse

READER_MESSAGE =
'Use attr_reader to define trivial reader methods.'
WRITER_MESSAGE =
'Use attr_writer to define trivial writer methods.'

Instance Attribute Summary

Attributes inherited from Cop

#correlations, #debug, #disabled_lines, #offences

Instance Method Summary collapse

Methods inherited from Cop

#add_offence, cop_name, #has_report?, inherited, #initialize, #name

Constructor Details

This class inherits a constructor from Rubocop::Cop::Cop

Instance Method Details

#inspect(file, source, token, sexp) ⇒ Object



9
10
11
12
13
# File 'lib/rubocop/cop/trivial_accessors.rb', line 9

def inspect(file, source, token, sexp)
  each(:def, sexp) do |def_block|
    find_trivial_accessors def_block
  end
end