Sha256: 6f2e01e786c1ca455640b5b100c6ebbb5a02237cade50e1bdd31315c2e84938f

Contents?: true

Size: 472 Bytes

Versions: 21

Compression:

Stored size: 472 Bytes

Contents

# frozen_string_literal: true

module Reek
  module AST
    module SexpExtensions
      # Utility methods for :case nodes.
      module CaseNode
        def condition
          children.first
        end

        def body_nodes(type, ignoring = [])
          children[1..-1].compact.flat_map do |child|
            child.each_node(type, ignoring | type).to_a
          end
        end

        def else_body
          children.last
        end
      end
    end
  end
end

Version data entries

21 entries across 19 versions & 2 rubygems

Version Path
reek-6.0.6 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.5 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.4 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.3 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.2 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.1 lib/reek/ast/sexp_extensions/case.rb
reek-6.0.0 lib/reek/ast/sexp_extensions/case.rb
reek-5.6.0 lib/reek/ast/sexp_extensions/case.rb
reek-5.5.0 lib/reek/ast/sexp_extensions/case.rb
reek-5.4.1 lib/reek/ast/sexp_extensions/case.rb
reek-5.4.0 lib/reek/ast/sexp_extensions/case.rb
reek-5.3.2 lib/reek/ast/sexp_extensions/case.rb
reek-5.3.1 lib/reek/ast/sexp_extensions/case.rb
reek-5.3.0 lib/reek/ast/sexp_extensions/case.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/ast/sexp_extensions/case.rb
config_gems_initialization_aim-0.1.4 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/ast/sexp_extensions/case.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/config_gems_initialization_aim-0.1.1/vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/ast/sexp_extensions/case.rb
config_gems_initialization_aim-0.1.3 vendor/bundle/ruby/2.5.0/gems/reek-5.2.0/lib/reek/ast/sexp_extensions/case.rb
reek-5.2.0 lib/reek/ast/sexp_extensions/case.rb
reek-5.1.0 lib/reek/ast/sexp_extensions/case.rb