Class: Stash::PullRequest
- Inherits:
-
Object
- Object
- Stash::PullRequest
- Defined in:
- lib/stash/pull_request.rb,
lib/stash/pull_request/diff.rb
Defined Under Namespace
Classes: Diff
Instance Attribute Summary collapse
-
#id ⇒ Object
Returns the value of attribute id.
-
#repository ⇒ Object
Returns the value of attribute repository.
Instance Method Summary collapse
- #add_comment(file, line, text) ⇒ Object
- #filenames_with_added_lines ⇒ Object
-
#initialize(repository, id) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(repository, id) ⇒ PullRequest
Returns a new instance of PullRequest.
7 8 9 10 |
# File 'lib/stash/pull_request.rb', line 7 def initialize(repository, id) self.repository = repository self.id = id end |
Instance Attribute Details
#id ⇒ Object
Returns the value of attribute id.
5 6 7 |
# File 'lib/stash/pull_request.rb', line 5 def id @id end |
#repository ⇒ Object
Returns the value of attribute repository.
5 6 7 |
# File 'lib/stash/pull_request.rb', line 5 def repository @repository end |
Instance Method Details
#add_comment(file, line, text) ⇒ Object
16 17 18 19 20 21 |
# File 'lib/stash/pull_request.rb', line 16 def add_comment(file, line, text) return unless diff.added_line?(file, line) return if already_commented?(file, line, text) post_comment(file, line, text) end |
#filenames_with_added_lines ⇒ Object
12 13 14 |
# File 'lib/stash/pull_request.rb', line 12 def filenames_with_added_lines diff.filenames_with_added_lines end |