Class: Krill::WrappedText
- Inherits:
-
Object
- Object
- Krill::WrappedText
- Defined in:
- lib/krill/wrapped_text.rb
Instance Method Summary collapse
- #height ⇒ Object
-
#initialize(text_box) ⇒ WrappedText
constructor
A new instance of WrappedText.
- #lines ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(text_box) ⇒ WrappedText
Returns a new instance of WrappedText.
4 5 6 |
# File 'lib/krill/wrapped_text.rb', line 4 def initialize(text_box) @text_box = text_box end |
Instance Method Details
#height ⇒ Object
8 9 10 |
# File 'lib/krill/wrapped_text.rb', line 8 def height @text_box.height end |
#lines ⇒ Object
12 13 14 |
# File 'lib/krill/wrapped_text.rb', line 12 def lines @text_box.printed_lines.map(&:to_s) end |
#width ⇒ Object
16 17 18 |
# File 'lib/krill/wrapped_text.rb', line 16 def width @text_box.printed_lines.map(&:width).max end |