Class: Fasterer::Github::OutputComposer
- Inherits:
-
Object
- Object
- Fasterer::Github::OutputComposer
- Defined in:
- lib/fasterer/github/output_composer.rb
Instance Method Summary collapse
- #add_api_errors(new_api_errors) ⇒ Object
- #add_errors(path) ⇒ Object
- #add_offences(offences, path) ⇒ Object
-
#initialize(owner, repo) ⇒ OutputComposer
constructor
A new instance of OutputComposer.
- #result ⇒ Object
Constructor Details
#initialize(owner, repo) ⇒ OutputComposer
Returns a new instance of OutputComposer.
4 5 6 7 |
# File 'lib/fasterer/github/output_composer.rb', line 4 def initialize(owner, repo) @repo_owner = owner @repo_name = repo end |
Instance Method Details
#add_api_errors(new_api_errors) ⇒ Object
20 21 22 |
# File 'lib/fasterer/github/output_composer.rb', line 20 def add_api_errors(new_api_errors) new_api_errors.each { |e| api_errors << e } end |
#add_errors(path) ⇒ Object
16 17 18 |
# File 'lib/fasterer/github/output_composer.rb', line 16 def add_errors(path) errors << { path: path } end |
#add_offences(offences, path) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/fasterer/github/output_composer.rb', line 9 def add_offences(offences, path) offences.each do |offence_name, lines| details = { path: path, lines: lines } (fasterer_offences[offence_name] ||= []) << details end end |
#result ⇒ Object
24 25 26 27 28 29 30 31 32 |
# File 'lib/fasterer/github/output_composer.rb', line 24 def result { repo_owner: repo_owner, repo_name: repo_name, fasterer_offences: fasterer_offences, errors: errors, api_errors: api_errors } end |