Class: Latex::Column
- Inherits:
-
Object
- Object
- Latex::Column
- Defined in:
- lib/ruby-latex.rb
Instance Attribute Summary collapse
-
#align ⇒ Object
readonly
Returns the value of attribute align.
-
#formatter ⇒ Object
readonly
Returns the value of attribute formatter.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
Instance Method Summary collapse
-
#initialize ⇒ Column
constructor
A new instance of Column.
- #with_align(align) ⇒ Object
- #with_center_align ⇒ Object
- #with_decimal_formatter(n = 2, comma = true) ⇒ Object
- #with_formatter(formatter) ⇒ Object
- #with_header(header) ⇒ Object
- #with_integer_formatter(comma = true) ⇒ Object
- #with_left_align ⇒ Object
- #with_right_align ⇒ Object
Constructor Details
#initialize ⇒ Column
Returns a new instance of Column.
258 259 260 261 262 |
# File 'lib/ruby-latex.rb', line 258 def initialize @formatter = Formatters::StringFormatter.new self.with_left_align end |
Instance Attribute Details
#align ⇒ Object (readonly)
Returns the value of attribute align.
254 255 256 |
# File 'lib/ruby-latex.rb', line 254 def align @align end |
#formatter ⇒ Object (readonly)
Returns the value of attribute formatter.
255 256 257 |
# File 'lib/ruby-latex.rb', line 255 def formatter @formatter end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
256 257 258 |
# File 'lib/ruby-latex.rb', line 256 def header @header end |
Instance Method Details
#with_align(align) ⇒ Object
284 285 286 287 |
# File 'lib/ruby-latex.rb', line 284 def with_align(align) @align = align return self end |
#with_center_align ⇒ Object
272 273 274 |
# File 'lib/ruby-latex.rb', line 272 def with_center_align self.with_align('c') end |
#with_decimal_formatter(n = 2, comma = true) ⇒ Object
280 281 282 |
# File 'lib/ruby-latex.rb', line 280 def with_decimal_formatter(n=2, comma=true) self.with_formatter(Formatters::DecimalFormatter.new(n, comma)) end |
#with_formatter(formatter) ⇒ Object
294 295 296 297 |
# File 'lib/ruby-latex.rb', line 294 def with_formatter(formatter) @formatter = formatter return self end |
#with_header(header) ⇒ Object
289 290 291 292 |
# File 'lib/ruby-latex.rb', line 289 def with_header(header) @header = header return self end |
#with_integer_formatter(comma = true) ⇒ Object
276 277 278 |
# File 'lib/ruby-latex.rb', line 276 def with_integer_formatter(comma=true) self.with_formatter(Formatters::IntegerFormatter.new(comma)) end |
#with_left_align ⇒ Object
264 265 266 |
# File 'lib/ruby-latex.rb', line 264 def with_left_align self.with_align('l') end |
#with_right_align ⇒ Object
268 269 270 |
# File 'lib/ruby-latex.rb', line 268 def with_right_align self.with_align('r') end |