Class: GemChanges::SummaryTable::Row
- Inherits:
-
Object
- Object
- GemChanges::SummaryTable::Row
- Defined in:
- lib/gem_changes/summary_table.rb
Instance Attribute Summary collapse
-
#change ⇒ Object
readonly
Returns the value of attribute change.
-
#gem ⇒ Object
readonly
Returns the value of attribute gem.
Instance Method Summary collapse
- #change_link ⇒ Object
- #changelog_link ⇒ Object
-
#initialize(change:) ⇒ Row
constructor
A new instance of Row.
- #markdown ⇒ Object
- #rubygems_link ⇒ Object
- #source_link ⇒ Object
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
#change ⇒ Object (readonly)
Returns the value of attribute change.
25 26 27 |
# File 'lib/gem_changes/summary_table.rb', line 25 def change @change end |
#gem ⇒ Object (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
#change_link ⇒ Object
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 |
#changelog_link ⇒ Object
55 56 57 |
# File 'lib/gem_changes/summary_table.rb', line 55 def changelog_link "[Changelog](#{gem.changelog_uri})" end |
#markdown ⇒ Object
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 |
#rubygems_link ⇒ Object
47 48 49 |
# File 'lib/gem_changes/summary_table.rb', line 47 def rubygems_link "[#{gem.name}](#{gem.rubygems_uri})" end |
#source_link ⇒ Object
51 52 53 |
# File 'lib/gem_changes/summary_table.rb', line 51 def source_link "[Source](#{gem.source_code_uri})" end |