Class: Fixnum

Inherits:
Object
  • Object
show all
Defined in:
lib/vedeu/api/grid.rb

Instance Method Summary collapse

Instance Method Details

#columnsObject

Augment Fixnum to calculate column width in a grid-based layout.

The grid system splits the terminal width into 12 equal parts, by dividing the available width by 12. If the terminal width is not a multiple of 12, then Grid chooses the maximum value which will fit.

Used primarily at interface creation time:

width: 9.columns  # (Terminal width / 12) * 9 characters wide; e.g.
                  # Terminal is 92 characters wide, maximum value is
                  # therefore 84, meaning a column is 7 characters wide.


13
14
15
# File 'lib/vedeu/api/grid.rb', line 13

def columns
   Vedeu::API::Grid.columns(self)
end