Sha256: 9a2712ae06f01d9dc810a6a4c8819cf45bc4069913430a82f122f8387eb0a6be

Contents?: true

Size: 585 Bytes

Versions: 7149

Compression:

Stored size: 585 Bytes

Contents

# frozen_string_literal: true

module RuboCop
  module Cop
    class VariableForce
      # Mix-in module for classes which own a node and need branch information
      # of the node. The user classes must implement #node and #scope.
      module Branchable
        def branch
          return @branch if instance_variable_defined?(:@branch)

          @branch = Branch.of(node, scope: scope)
        end

        def run_exclusively_with?(other)
          return false if !branch || !other.branch

          branch.exclusive_with?(other.branch)
        end
      end
    end
  end
end

Version data entries

7,149 entries across 7,110 versions & 50 rubygems

Version Path
rubocop-1.5.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.5.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.4.2 lib/rubocop/cop/variable_force/branchable.rb
passbase-1.2.0 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.4.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.4.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.3.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.3.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.2.0 lib/rubocop/cop/variable_force/branchable.rb
passbase-1.1.0 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
passbase-1.0.3 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.1.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-1.0.0 lib/rubocop/cop/variable_force/branchable.rb
passbase-1.0.2 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
passbase-1.0.1 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
passbase-1.0.0 vendor/bundle/ruby/2.7.0/gems/rubocop-0.66.0/lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.93.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.93.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.92.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.91.1 lib/rubocop/cop/variable_force/branchable.rb