Class: RuboCop::Cop::Style::RedundantReturn

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

Constant Summary collapse

YAYOI_MSG =
"ζ*'ヮ')ζ<うっうー!冗長な`return`がありますよー!".freeze
YAYOI_MULTI_RETURN_YAYOI_MSG =
"ζ*'ヮ')ζ<うっうー!" \
'複数の値を返すときは配列を使いましょうねー!'.freeze

Instance Method Summary collapse

Instance Method Details

#message(node) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/rubocop/cop/style/redundant_return.rb', line 11

def message(node)
  if !allow_multiple_return_values? && node.children.size > 1
    "#{YAYOI_MSG} #{YAYOI_MULTI_RETURN_YAYOI_MSG}"
  else
    YAYOI_MSG
  end
end