Class: Nineteen::Eighty::Two::Formats::Text
- Inherits:
-
Object
- Object
- Nineteen::Eighty::Two::Formats::Text
- Defined in:
- lib/nineteen/eighty/two/formatters/text_formatter.rb
Class Method Summary collapse
Class Method Details
.format(text, options = {}) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/nineteen/eighty/two/formatters/text_formatter.rb', line 6 def self.format text, = {} on = .fetch(:on, '1') off = .fetch(:off, '0') Spectrum[*text].map do |t| t.join end.join("\n"). gsub('0', off). gsub('1', on) end |