mbj/to_source

View on GitHub
lib/to_source/emitter/block.rb

Summary

Maintainability
A
0 mins
Test Coverage
module ToSource
  class Emitter
    # Emiter for blocks
    class Block < self
      
      handle(Rubinius::AST::Block)

    private

      # Perform dispatch
      #
      # @return [undefined]
      #
      # @api private
      #
      def dispatch
        array = node.array
        max = array.length-1
        array.each_with_index do |node, index|
          visit(node)
          if index < max
            new_line
          end
        end
      end

    end
  end
end