Class: GemChanges::SummaryTable

Inherits:
Object
  • Object
show all
Defined in:
lib/gem_changes/summary_table.rb

Defined Under Namespace

Classes: Row

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(changes:) ⇒ SummaryTable

Returns a new instance of SummaryTable.



7
8
9
# File 'lib/gem_changes/summary_table.rb', line 7

def initialize(changes:)
  @changes = changes
end

Instance Attribute Details

#changesObject (readonly)

Returns the value of attribute changes.



5
6
7
# File 'lib/gem_changes/summary_table.rb', line 5

def changes
  @changes
end

Instance Method Details

#markdownObject



11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/gem_changes/summary_table.rb', line 11

def markdown
  string = ""

  string += "| Gem | Source | Changelog | Change | Version | Level |\n"
  string += "| :-: | :----: | :-------: | :----: | :-----: | :---: |\n"

  rows = changes.map { |change| Row.new(change:) }

  string += rows.map(&:markdown).join

  string
end