Class: Monosheet::OutputTableRowDivider

Inherits:
Object
  • Object
show all
Includes:
ClassLevelInheritableAttributes
Defined in:
lib/monosheet/output_table_row_divider.rb

Instance Method Summary collapse

Methods included from ClassLevelInheritableAttributes

included

Constructor Details

#initialize(line_char = "-") ⇒ OutputTableRowDivider

Returns a new instance of OutputTableRowDivider.



6
7
8
# File 'lib/monosheet/output_table_row_divider.rb', line 6

def initialize(line_char="-")
  @line_char = line_char 
end

Instance Method Details

#render(*args) ⇒ Object

ugly temporary hack because of the contract-by-design thing I’ve got going on with the “render” method



10
11
12
13
14
15
16
# File 'lib/monosheet/output_table_row_divider.rb', line 10

def render(*args) # ugly temporary hack because of the contract-by-design thing I've got going on with the "render" method
  divider_output = "+"
  self.class.column_size.each do |column_width_in_characters|
    divider_output << "#{@line_char}#{@line_char * column_width_in_characters}#{@line_char}+"
  end
  divider_output
end