Sha256: 99a081fabe950e4f8381319e12389ff552f4b9c8932e7e30ae55a75c9c6b253d

Contents?: true

Size: 560 Bytes

Versions: 6

Compression:

Stored size: 560 Bytes

Contents

# encoding: utf-8

module RuboCop
  module Cop
    # Common functionality for cops checking if and unless statements.
    module OnNormalIfUnless
      include IfNode

      def on_if(node)
        invoke_hook_for_normal_if_unless(node)
      end

      def on_unless(node)
        invoke_hook_for_normal_if_unless(node)
      end

      def invoke_hook_for_normal_if_unless(node)
        # We won't check modifier or ternary conditionals.
        return if modifier_if?(node) || ternary_op?(node)
        on_normal_if_unless(node)
      end
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
rubyjobbuilderdsl-0.0.2 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/on_normal_if_unless.rb
rubyjobbuilderdsl-0.0.1 vendor/bundle/ruby/2.1.0/gems/rubocop-0.26.0/lib/rubocop/cop/mixin/on_normal_if_unless.rb
rubocop-0.27.0 lib/rubocop/cop/mixin/on_normal_if_unless.rb
rubocop-0.26.1 lib/rubocop/cop/mixin/on_normal_if_unless.rb
rubocop-0.26.0 lib/rubocop/cop/mixin/on_normal_if_unless.rb
rubocop-0.25.0 lib/rubocop/cop/mixin/on_normal_if_unless.rb