Class: GemChanges::SummaryTable::Row

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(change:) ⇒ Row

Returns a new instance of Row.



27
28
29
30
# File 'lib/gem_changes/summary_table.rb', line 27

def initialize(change:)
  @change = change
  @gem = change.gem
end

Instance Attribute Details

#changeObject (readonly)

Returns the value of attribute change.



25
26
27
# File 'lib/gem_changes/summary_table.rb', line 25

def change
  @change
end

#gemObject (readonly)

Returns the value of attribute gem.



25
26
27
# File 'lib/gem_changes/summary_table.rb', line 25

def gem
  @gem
end

Instance Method Details



59
60
61
62
63
64
65
66
67
68
# File 'lib/gem_changes/summary_table.rb', line 59

def change_link
  text = change_text
  link = compare_uri

  if link
    "[#{text}](#{link})"
  else
    text
  end
end


55
56
57
# File 'lib/gem_changes/summary_table.rb', line 55

def changelog_link
  "[Changelog](#{gem.changelog_uri})"
end

#markdownObject



32
33
34
35
36
37
38
39
40
41
42
43
44
45
# File 'lib/gem_changes/summary_table.rb', line 32

def markdown
  string = "| "

  string += [
    rubygems_link,
    source_link,
    changelog_link,
    change_link
  ].join(" | ")

  string += " |\n"

  string
end


47
48
49
# File 'lib/gem_changes/summary_table.rb', line 47

def rubygems_link
  "[#{gem.name}](#{gem.rubygems_uri})"
end


51
52
53
# File 'lib/gem_changes/summary_table.rb', line 51

def source_link
  "[Source](#{gem.source_code_uri})"
end