Class: ReportItems

Inherits:
Object
  • Object
show all
Defined in:
lib/newsman/report.rb

Overview

Report items inner class.

Instance Method Summary collapse

Constructor Details

#initialize(prs, issues) ⇒ ReportItems

Returns a new instance of ReportItems.



68
69
70
71
# File 'lib/newsman/report.rb', line 68

def initialize(prs, issues)
  @prs = prs || []
  @issues = issues || []
end

Instance Method Details

#empty?Boolean

Returns true if there are no pull requests or issues, false otherwise

Returns:

  • (Boolean)


74
75
76
# File 'lib/newsman/report.rb', line 74

def empty?
  @prs.empty? && @issues.empty?
end

#to_sObject



78
79
80
81
82
# File 'lib/newsman/report.rb', line 78

def to_s
  prs_list = @prs.map(&:detailed_title).map { |obj| " - #{obj}\n" }.join
  issues_list = @issues.map(&:detailed_title).map { |obj| " - #{obj}\n" }.join
  "Closed Pull Requests:\n#{prs_list}\nOpen Issues:\n#{issues_list}"
end