Class: MarkdownTable::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/markdown_table/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(fields:) ⇒ Row

Returns a new instance of Row.



7
8
9
# File 'lib/markdown_table/row.rb', line 7

def initialize(fields:)
  @fields = fields
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



5
6
7
# File 'lib/markdown_table/row.rb', line 5

def fields
  @fields
end

Instance Method Details

#generateObject



11
12
13
# File 'lib/markdown_table/row.rb', line 11

def generate
  "|#{@fields.join('|')}|\n"
end