Sha256: aea629824e5d6c315d2699a741a859147f08e20f10cfb02edaafac3baaf72279

Contents?: true

Size: 583 Bytes

Versions: 19

Compression:

Stored size: 583 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

19 entries across 19 versions & 2 rubygems

Version Path
rubocop-0.58.2 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.58.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.58.0 lib/rubocop/cop/variable_force/branchable.rb
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/rubocop-0.57.2/lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.57.2 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.57.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.57.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.56.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.55.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.54.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.53.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.52.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.52.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.51.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.50.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.49.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.49.0 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.48.1 lib/rubocop/cop/variable_force/branchable.rb
rubocop-0.48.0 lib/rubocop/cop/variable_force/branchable.rb