Module: BerkeleyLibrary::TIND::Export::Config
- Included in:
- ColumnWidthCalculator, TableMetrics
- Defined in:
- lib/berkeley_library/tind/export/config.rb
Constant Summary collapse
- FONT_SIZE_DEFAULT =
Font size in points
10.0
- WIDTH_INCREMENT_DEFAULT_INCHES =
Round column widths up to nearest eighth inch
'1/8'.to_r
- HEIGHT_INCREMENT_DEFAULT_POINTS =
Round row heights up to nearest 2 points
2
- MAX_COLUMN_WIDTH_INCHES =
Max column width before wrapping
5.0
- FORMAT_DIGITS_DEFAULT =
Decimal places for formatting
3
- LINE_HEIGHT_DEFAULT_EM =
Line height as multiple of font size
'4/3'.to_r
Class Method Summary collapse
-
.font_size_pt ⇒ Numeric
The font size in points.
- .font_size_pt=(value) ⇒ Object
-
.format_digits ⇒ Integer
The number of digits to use when formatting values.
- .format_digits=(value) ⇒ Object
-
.h_incr_pt ⇒ Numeric
The height rounding increment in points.
- .h_incr_pt=(value) ⇒ Object
-
.line_height_em ⇒ Numeric
The line height in ems (multiples of the font point size).
- .line_height_em=(value) ⇒ Object
-
.max_col_width_in ⇒ Numeric
The max column width in inches.
- .max_col_width_in=(value) ⇒ Object
-
.w_incr_in ⇒ Numeric
The width rounding increment in inches.
- .w_incr_in=(value) ⇒ Object
Instance Method Summary collapse
-
#font_size_pt ⇒ Numeric
The font size in points.
-
#format_digits ⇒ Integer
The number of digits to use when formatting values.
-
#h_incr_pt ⇒ Numeric
The height rounding increment in points.
-
#line_height_em ⇒ Numeric
The line height in ems (multiples of the font point size).
-
#max_col_width_in ⇒ Numeric
The max column width in inches.
-
#w_incr_in ⇒ Numeric
The width rounding increment in inches.
Class Method Details
.font_size_pt ⇒ Numeric
Returns the font size in points.
58 59 60 |
# File 'lib/berkeley_library/tind/export/config.rb', line 58 def font_size_pt @font_size_pt ||= ensure_positive_numeric(ENV['ODS_FONT_SIZE_DEFAULT'] || Config::FONT_SIZE_DEFAULT) end |
.font_size_pt=(value) ⇒ Object
62 63 64 |
# File 'lib/berkeley_library/tind/export/config.rb', line 62 def font_size_pt=(value) @font_size_pt = ensure_positive_numeric(value) end |
.format_digits ⇒ Integer
Returns the number of digits to use when formatting values.
103 104 105 |
# File 'lib/berkeley_library/tind/export/config.rb', line 103 def format_digits @format_digits ||= ensure_positive_int(ENV['ODS_FORMAT_DIGITS_DEFAULT'] || Config::FORMAT_DIGITS_DEFAULT) end |
.format_digits=(value) ⇒ Object
107 108 109 |
# File 'lib/berkeley_library/tind/export/config.rb', line 107 def format_digits=(value) @format_digits = ensure_positive_int(value) end |
.h_incr_pt ⇒ Numeric
Returns the height rounding increment in points.
85 86 87 |
# File 'lib/berkeley_library/tind/export/config.rb', line 85 def h_incr_pt @h_incr_pt ||= ensure_positive_numeric(ENV['ODS_HEIGHT_INCREMENT_DEFAULT_POINTS'] || Config::HEIGHT_INCREMENT_DEFAULT_POINTS) end |
.h_incr_pt=(value) ⇒ Object
89 90 91 |
# File 'lib/berkeley_library/tind/export/config.rb', line 89 def h_incr_pt=(value) @h_incr_pt = ensure_positive_numeric(value) end |
.line_height_em ⇒ Numeric
Returns the line height in ems (multiples of the font point size).
94 95 96 |
# File 'lib/berkeley_library/tind/export/config.rb', line 94 def line_height_em @line_height_em ||= ensure_positive_numeric(ENV['ODS_LINE_HEIGHT_DEFAULT_EM'] || Config::LINE_HEIGHT_DEFAULT_EM) end |
.line_height_em=(value) ⇒ Object
98 99 100 |
# File 'lib/berkeley_library/tind/export/config.rb', line 98 def line_height_em=(value) @line_height_em = ensure_positive_numeric(value) end |
.max_col_width_in ⇒ Numeric
Returns the max column width in inches.
67 68 69 |
# File 'lib/berkeley_library/tind/export/config.rb', line 67 def max_col_width_in @max_col_width_in ||= ensure_positive_numeric(ENV['ODS_MAX_COLUMN_WIDTH_INCHES'] || Config::MAX_COLUMN_WIDTH_INCHES) end |
.max_col_width_in=(value) ⇒ Object
71 72 73 |
# File 'lib/berkeley_library/tind/export/config.rb', line 71 def max_col_width_in=(value) @max_col_width_in = ensure_positive_numeric(value) end |
.w_incr_in ⇒ Numeric
Returns the width rounding increment in inches.
76 77 78 |
# File 'lib/berkeley_library/tind/export/config.rb', line 76 def w_incr_in @w_incr_in ||= ensure_positive_numeric(ENV['ODS_WIDTH_INCREMENT_DEFAULT_INCHES'] || Config::WIDTH_INCREMENT_DEFAULT_INCHES) end |
.w_incr_in=(value) ⇒ Object
80 81 82 |
# File 'lib/berkeley_library/tind/export/config.rb', line 80 def w_incr_in=(value) @w_incr_in = ensure_positive_numeric(value) end |
Instance Method Details
#font_size_pt ⇒ Numeric
Returns the font size in points.
25 26 27 |
# File 'lib/berkeley_library/tind/export/config.rb', line 25 def font_size_pt Config.font_size_pt end |
#format_digits ⇒ Integer
Returns the number of digits to use when formatting values.
50 51 52 |
# File 'lib/berkeley_library/tind/export/config.rb', line 50 def format_digits Config.format_digits end |
#h_incr_pt ⇒ Numeric
Returns the height rounding increment in points.
40 41 42 |
# File 'lib/berkeley_library/tind/export/config.rb', line 40 def h_incr_pt Config.h_incr_pt end |
#line_height_em ⇒ Numeric
Returns the line height in ems (multiples of the font point size).
45 46 47 |
# File 'lib/berkeley_library/tind/export/config.rb', line 45 def line_height_em Config.line_height_em end |
#max_col_width_in ⇒ Numeric
Returns the max column width in inches.
30 31 32 |
# File 'lib/berkeley_library/tind/export/config.rb', line 30 def max_col_width_in Config.max_col_width_in end |