Sha256: 1a81afd3a65351da3ea69a99452eb72f3656a8cfcc3f573b1805196566178ef0

Contents?: true

Size: 1.02 KB

Versions: 1

Compression:

Stored size: 1.02 KB

Contents

require_relative "default_printer"
require_relative "printer"

module CutePrint

  # Methods mixed into Object, and so available globally.
  #
  # @note The methods in this module are part of the public API, but
  #   the module itself is not.
  module Mixin

    # @see Printer#q
    def q(*args, &block)
      CutePrint::DefaultPrinter.printer.q(*args, &block)
    end

    # @see Printer#ql
    def ql(*args, &block)
      CutePrint::DefaultPrinter.printer.ql(*args, &block)
    end

    # @see Printer#qq
    def qq(*args, &block)
      CutePrint::DefaultPrinter.printer.qq(*args, &block)
    end

    # @see Printer#qql
    def qql(*args, &block)
      CutePrint::DefaultPrinter.printer.qql(*args, &block)
    end

    # Debug a call chain by printing self and then returning self.
    # @return [Object] self
    def tapq
      q self
      self
    end

    # Debug a call chain by printing self, with source position, and
    # then returning self.
    # @return [Object] self
    def tapql
      ql self
      self
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cute_print-0.2.0 lib/cute_print/mixin.rb