Class: PrLog::Formatter

Inherits:
Struct
  • Object
show all
Defined in:
lib/pr_log/formatter.rb

Overview

Format new pull requests from github search response

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#entry_templateObject

Returns the value of attribute entry_template

Returns:

  • (Object)

    the current value of entry_template



3
4
5
# File 'lib/pr_log/formatter.rb', line 3

def entry_template
  @entry_template
end

#label_prefixesObject

Returns the value of attribute label_prefixes

Returns:

  • (Object)

    the current value of label_prefixes



3
4
5
# File 'lib/pr_log/formatter.rb', line 3

def label_prefixes
  @label_prefixes
end

#pull_requestsObject

Returns the value of attribute pull_requests

Returns:

  • (Object)

    the current value of pull_requests



3
4
5
# File 'lib/pr_log/formatter.rb', line 3

def pull_requests
  @pull_requests
end

Instance Method Details

#entriesObject



7
8
9
10
11
12
13
# File 'lib/pr_log/formatter.rb', line 7

def entries
  return '' if pull_requests.empty?

  pull_requests.map do |pull_request|
    entry_template % entry_template_data(pull_request)
  end.join.prepend("\n")
end