Sha256: 8073b88a21e84731c8a22c12ad40dc0be9e7aba090aba73e105596c7ccede8e6

Contents?: true

Size: 563 Bytes

Versions: 5

Compression:

Stored size: 563 Bytes

Contents

# frozen_string_literal: true

module TTY
  class Font
    # Represents font rendering result. It provides more
    # convenient interface for using the output.
    class Result
      include Enumerable

      def initialize
        @output = []
      end

      def each(&block)
        return to_enum(:each) unless block
        @output.each(&block)
      end

      def add(line)
        @output << line
      end
      alias << add

      def lines
        @output
      end

      def to_s
        @output.join("\n")
      end
    end
  end # Font
end # TTY

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
jscop-0.1.2 vendor/cache/ruby/2.6.0/gems/tty-font-0.5.0/lib/tty/font/result.rb
tty-font-0.5.0 lib/tty/font/result.rb
tty-font-0.4.0 lib/tty/font/result.rb
tty-font-0.3.0 lib/tty/font/result.rb
tty-font-0.2.0 lib/tty/font/result.rb