Class: MonoclePrint::Vertical
- 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
41 42 43 44 45 |
# File 'lib/monocle-print/layout.rb', line 41 def height inject( 0 ) do | height, view | height + view.height end end |
#render ⇒ Object
47 48 49 50 51 |
# File 'lib/monocle-print/layout.rb', line 47 def render map { | i | i.render }.inject do | out, text | out.concat( text ) end.fix! end |
#width ⇒ Object
37 38 39 |
# File 'lib/monocle-print/layout.rb', line 37 def width empty? ? 0 : collect { | view | view.width }.max end |