Class: Policial::PullRequest
- Inherits:
-
Object
- Object
- Policial::PullRequest
- Defined in:
- lib/policial/pull_request.rb
Overview
Public: A GitHub Pull Request.
Instance Attribute Summary collapse
-
#github_client ⇒ Object
Returns the value of attribute github_client.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
-
#repo ⇒ Object
readonly
Returns the value of attribute repo.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #files ⇒ Object
- #head_commit ⇒ Object
-
#initialize(repo:, number:, head_sha:, github_client:, user: nil) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(repo:, number:, head_sha:, github_client:, user: nil) ⇒ PullRequest
Returns a new instance of PullRequest.
9 10 11 12 13 14 15 |
# File 'lib/policial/pull_request.rb', line 9 def initialize(repo:, number:, head_sha:, github_client:, user: nil) @repo = repo @number = number @head_sha = head_sha @user = user @github_client = github_client end |
Instance Attribute Details
#github_client ⇒ Object
Returns the value of attribute github_client.
7 8 9 |
# File 'lib/policial/pull_request.rb', line 7 def github_client @github_client end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
6 7 8 |
# File 'lib/policial/pull_request.rb', line 6 def number @number end |
#repo ⇒ Object (readonly)
Returns the value of attribute repo.
6 7 8 |
# File 'lib/policial/pull_request.rb', line 6 def repo @repo end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
6 7 8 |
# File 'lib/policial/pull_request.rb', line 6 def user @user end |
Instance Method Details
#files ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/policial/pull_request.rb', line 17 def files @files ||= @github_client.pull_request_files( @repo, @number ).map do |file| build_commit_file(file) end end |