Sha256: ca1bdad137111a01aa9e7992c34c481783e21cec8e4f9577dd29bc89cbd532d1

Contents?: true

Size: 578 Bytes

Versions: 28

Compression:

Stored size: 578 Bytes

Contents

# frozen_string_literal: true
module Reek
  module AST
    module SexpExtensions
      # Base module for utility methods for :and and :or nodes.
      module LogicOperatorBase
        def condition
          children.first
        end

        def body_nodes(type, ignoring = [])
          children[1].find_nodes type, ignoring
        end
      end

      # Utility methods for :and nodes.
      module AndNode
        include LogicOperatorBase
      end

      # Utility methods for :or nodes.
      module OrNode
        include LogicOperatorBase
      end
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
reek-4.6.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.6.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.6 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.5 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.4 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.3 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.2 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.5.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.4.2 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.4.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.4.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.3.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.5 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.4 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.3 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.2 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.2.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-4.1.1 lib/reek/ast/sexp_extensions/logical_operators.rb