Class: TTY::Font::Result
- Inherits:
-
Object
- Object
- TTY::Font::Result
- 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
- #add(line) ⇒ Object (also: #<<)
- #each(&block) ⇒ Object
-
#initialize ⇒ Result
constructor
A new instance of Result.
- #lines ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize ⇒ Result
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 |
#lines ⇒ Object
24 25 26 |
# File 'lib/tty/font/result.rb', line 24 def lines @output end |
#to_s ⇒ Object
28 29 30 |
# File 'lib/tty/font/result.rb', line 28 def to_s @output.join("\n") end |