Sha256: d719e493c637b757cee808eceaca4cd49e54f6dded4c95bc1e358eaf8f58fa33

Contents?: true

Size: 575 Bytes

Versions: 14

Compression:

Stored size: 575 Bytes

Contents

module Reek
  module AST
    module SexpExtensions
      # Utility methods for :block nodes.
      module BlockNode
        def call
          children.first
        end

        def args
          children[1]
        end

        def block
          children[2]
        end

        def parameters
          children[1] || []
        end

        def parameter_names
          parameters.children
        end

        def simple_name
          :block
        end

        def without_block_arguments?
          args.components.empty?
        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/block.rb
reek-3.10.2 lib/reek/ast/sexp_extensions/block.rb
reek-3.10.1 lib/reek/ast/sexp_extensions/block.rb
reek-3.10.0 lib/reek/ast/sexp_extensions/block.rb
reek-3.9.1 lib/reek/ast/sexp_extensions/block.rb
reek-3.9.0 lib/reek/ast/sexp_extensions/block.rb
reek-3.8.3 lib/reek/ast/sexp_extensions/block.rb
reek-3.8.2 lib/reek/ast/sexp_extensions/block.rb
reek-3.8.1 lib/reek/ast/sexp_extensions/block.rb
reek-3.8.0 lib/reek/ast/sexp_extensions/block.rb
reek-3.7.1 lib/reek/ast/sexp_extensions/block.rb
reek-3.7.0 lib/reek/ast/sexp_extensions/block.rb
reek-3.6.1 lib/reek/ast/sexp_extensions/block.rb
reek-3.6.0 lib/reek/ast/sexp_extensions/block.rb