Sha256: 815b398b3ca6813e2b004f38a4210af9d47a01b46993e5fb60a652e8350e7b7b

Contents?: true

Size: 405 Bytes

Versions: 14

Compression:

Stored size: 405 Bytes

Contents

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 { |child| child.find_nodes(type, ignoring) }
        end

        def else_body
          children.last
        end
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
reek-3.11 lib/reek/ast/sexp_extensions/case.rb
reek-3.10.2 lib/reek/ast/sexp_extensions/case.rb
reek-3.10.1 lib/reek/ast/sexp_extensions/case.rb
reek-3.10.0 lib/reek/ast/sexp_extensions/case.rb
reek-3.9.1 lib/reek/ast/sexp_extensions/case.rb
reek-3.9.0 lib/reek/ast/sexp_extensions/case.rb
reek-3.8.3 lib/reek/ast/sexp_extensions/case.rb
reek-3.8.2 lib/reek/ast/sexp_extensions/case.rb
reek-3.8.1 lib/reek/ast/sexp_extensions/case.rb
reek-3.8.0 lib/reek/ast/sexp_extensions/case.rb
reek-3.7.1 lib/reek/ast/sexp_extensions/case.rb
reek-3.7.0 lib/reek/ast/sexp_extensions/case.rb
reek-3.6.1 lib/reek/ast/sexp_extensions/case.rb
reek-3.6.0 lib/reek/ast/sexp_extensions/case.rb