Class: Rubocop::Cop::SpaceAfterColon

Inherits:
Cop
  • Object
show all
Includes:
SpaceAfterCommaEtc
Defined in:
lib/rubocop/cop/space_after_comma_etc.rb

Constant Summary

Constants included from SpaceAfterCommaEtc

Rubocop::Cop::SpaceAfterCommaEtc::ERROR_MESSAGE

Instance Attribute Summary

Attributes inherited from Cop

#correlations, #offences

Instance Method Summary collapse

Methods included from SpaceAfterCommaEtc

#inspect

Methods inherited from Cop

#add_offence, #has_report?, inherited, #initialize

Constructor Details

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

Instance Method Details

#kind(token) ⇒ Object



34
35
36
37
38
39
# File 'lib/rubocop/cop/space_after_comma_etc.rb', line 34

def kind(token)
  case token.type
  when :on_label then 'colon'
  when :on_op    then 'colon' if token.text == ':'
  end
end