Class: TTY::Font::Result

Inherits:
Object
  • Object
show all
Includes:
Enumerable
Defined in:
lib/tty/font/result.rb

Overview

Represents font rendering result. It provides more convenient interface for using the output.

Instance Method Summary collapse

Constructor Details

#initializeResult

Returns a new instance of Result.



10
11
12
# File 'lib/tty/font/result.rb', line 10

def initialize
  @output = []
end

Instance Method Details

#add(line) ⇒ Object Also known as: <<



19
20
21
# File 'lib/tty/font/result.rb', line 19

def add(line)
  @output << line
end

#each(&block) ⇒ Object



14
15
16
17
# File 'lib/tty/font/result.rb', line 14

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

#linesObject



24
25
26
# File 'lib/tty/font/result.rb', line 24

def lines
  @output
end

#to_sObject



28
29
30
# File 'lib/tty/font/result.rb', line 28

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