Sha256: e8c50d98495a4df70a715ce159114dc41fb883c172a163c6199aee6123b3963f

Contents?: true

Size: 587 Bytes

Versions: 29

Compression:

Stored size: 587 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].each_node type, (ignoring | type)
        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

29 entries across 27 versions & 2 rubygems

Version Path
reek-6.4.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.3.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.2.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.1.4 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.1.3 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.1.2 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.1.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.1.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.6 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.5 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.4 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.3 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.2 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-6.0.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-5.6.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-5.5.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-5.4.1 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-5.4.0 lib/reek/ast/sexp_extensions/logical_operators.rb
reek-5.3.2 lib/reek/ast/sexp_extensions/logical_operators.rb