class Pry::Output - pry-0.10.1 Documentation

# class Pry::Output

### Attributes

_pry_[R]

### Public Class Methods

new(_pry_) click to toggle source

    # File lib/pry/output.rb, line 5
    def initialize(_pry_)
      @_pry_ = _pry_
    end

### Public Instance Methods

<<(*objs)
Alias for: print
decolorize_maybe(str) click to toggle source

If pry.config.color is currently false, removes ansi escapes from the string.

    # File lib/pry/output.rb, line 34
    def decolorize_maybe(str)
      if _pry_.config.color
        str
      else
        Helpers::Text.strip_color str
      end
    end

method_missing(name, *args, &block) click to toggle source

    # File lib/pry/output.rb, line 42
    def method_missing(name, *args, &block)
      _pry_.config.output.send(name, *args, &block)
    end

print(*objs) click to toggle source

    # File lib/pry/output.rb, line 23
    def print(*objs)
      objs.each do |obj|
        _pry_.config.output.print decolorize_maybe(obj.to_s)
      end

      nil
    end

Also aliased as: <<, write
puts(*objs) click to toggle source

    # File lib/pry/output.rb, line 9
    def puts(*objs)
      return print "\n" if objs.empty?

      objs.each do |obj|
        if ary = Array.try_convert(obj)
          puts(*ary)
        else
          print "#{obj.to_s.chomp}\n"
        end
      end

      nil
    end

respond_to_missing?(*a) click to toggle source

    # File lib/pry/output.rb, line 46
    def respond_to_missing?(*a)
      _pry_.config.respond_to?(*a)
    end

write(*objs)
Alias for: print