Class: Latex::Column

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-latex.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeColumn

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

#alignObject (readonly)

Returns the value of attribute align.



254
255
256
# File 'lib/ruby-latex.rb', line 254

def align
  @align
end

#formatterObject (readonly)

Returns the value of attribute formatter.



255
256
257
# File 'lib/ruby-latex.rb', line 255

def formatter
  @formatter
end

#headerObject (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_alignObject



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_alignObject



264
265
266
# File 'lib/ruby-latex.rb', line 264

def with_left_align
    self.with_align('l')
end

#with_right_alignObject



268
269
270
# File 'lib/ruby-latex.rb', line 268

def with_right_align
    self.with_align('r')
end