Class: Painless::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/painless-table/table.rb,
lib/painless-table/borderline.rb

Defined Under Namespace

Classes: Borderline

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(parameters = {}) ⇒ Table

Returns a new instance of Table.



7
8
9
10
# File 'lib/painless-table/table.rb', line 7

def initialize parameters={}
  @heading = parameters.fetch :heading, []
  @objects = parameters.fetch :objects, []
end

Instance Attribute Details

#cell_sizesObject (readonly)

Returns the value of attribute cell_sizes.



5
6
7
# File 'lib/painless-table/table.rb', line 5

def cell_sizes
  @cell_sizes
end

#headingObject (readonly)

Returns the value of attribute heading.



5
6
7
# File 'lib/painless-table/table.rb', line 5

def heading
  @heading
end

#objectsObject (readonly)

Returns the value of attribute objects.



5
6
7
# File 'lib/painless-table/table.rb', line 5

def objects
  @objects
end

#separate_rowsObject (readonly)

Returns the value of attribute separate_rows.



5
6
7
# File 'lib/painless-table/table.rb', line 5

def separate_rows
  @separate_rows
end

Instance Method Details

#to_sObject



12
13
14
# File 'lib/painless-table/table.rb', line 12

def to_s
  draw_heading + draw_body
end