Common functionality for cops checking if and unless statements.
# File lib/rubocop/cop/mixin/if_then_else.rb, line 14 def check(node) # We won't check modifier or ternary conditionals. return unless node.loc.expression.source =~ /\A(if|unless)\b/ return unless offending_line(node) add_offense(node, :expression, error_message(node)) end
Generated with the Darkfish Rdoc Generator 2.