Class: MonoclePrint::Horizontal
- Defined in:
- lib/monocle-print/layout.rb
Constant Summary
Constants included from Presentation
Constants included from MonoclePrint
COLOR_ESCAPE, FOUR_BYTES, MULTIBYTE_CHARACTER, ONE_BYTE, THREE_BYTES, TWO_BYTES, VERSION
Instance Attribute Summary
Attributes included from Presentation
Instance Method Summary collapse
Methods inherited from Layout
Methods included from Presentation
#alignment, #alignment=, included, #output, #output=, #style, #style=, #to_s
Methods included from MonoclePrint
Line, Output, Rectangle, Style, Text, buffer, included, library_path, stderr, stdout, version
Constructor Details
This class inherits a constructor from MonoclePrint::Layout
Instance Method Details
#height ⇒ Object
23 24 25 |
# File 'lib/monocle-print/layout.rb', line 23 def height empty? ? 0 : collect { | view | view.height }.max end |
#render ⇒ Object
27 28 29 30 31 |
# File 'lib/monocle-print/layout.rb', line 27 def render map { | i | i.render }.inject do | out, text | out.juxtapose!( text ) end end |
#width ⇒ Object
17 18 19 20 21 |
# File 'lib/monocle-print/layout.rb', line 17 def width inject( 0 ) do | width, view | width + view.width end end |