Sha256: 10cac6c5c3afdf376988906e33020364c8408fd266a9792173990914ba4b1316

Contents?: true

Size: 994 Bytes

Versions: 11

Compression:

Stored size: 994 Bytes

Contents

# frozen_string_literal: true

module Unparser
  class Emitter
    class Send
      # Emitter for binary sends
      class Binary < self
        include Unterminated

      private

        # Return undefined
        #
        # @return [undefined]
        #
        # @api private
        #
        def dispatch
          visit(receiver)
          emit_operator
          emit_right
        end

        # Emit operator
        #
        # @return [undefined]
        #
        # @api private
        #
        def emit_operator
          write(WS, string_selector, WS)
        end

        # Return right node
        #
        # @return [Parser::AST::Node]
        #
        # @api private
        #
        def right_node
          children[2]
        end

        # Emit right
        #
        # @return [undefined]
        #
        # @api private
        #
        def emit_right
          visit(right_node)
        end

      end # Binary
    end # Send
  end # Emitter
end # Unparser

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
unparser-0.4.9 lib/unparser/emitter/send/binary.rb
unparser-0.4.8 lib/unparser/emitter/send/binary.rb
unparser-0.4.7 lib/unparser/emitter/send/binary.rb
unparser-0.4.6 lib/unparser/emitter/send/binary.rb
unparser-0.4.5 lib/unparser/emitter/send/binary.rb
unparser-0.4.4 lib/unparser/emitter/send/binary.rb
unparser-0.4.3 lib/unparser/emitter/send/binary.rb
unparser-0.4.2 lib/unparser/emitter/send/binary.rb
unparser-0.4.1 lib/unparser/emitter/send/binary.rb
unparser-0.4.0 lib/unparser/emitter/send/binary.rb
unparser-0.3.0 lib/unparser/emitter/send/binary.rb