Class: Danger::LocalPullRequest
- Inherits:
-
Object
- Object
- Danger::LocalPullRequest
- Defined in:
- lib/danger/ci_source/support/local_pull_request.rb
Instance Attribute Summary collapse
-
#pull_request_id ⇒ Object
readonly
Returns the value of attribute pull_request_id.
-
#sha ⇒ Object
readonly
Returns the value of attribute sha.
Instance Method Summary collapse
-
#initialize(log_line) ⇒ LocalPullRequest
constructor
A new instance of LocalPullRequest.
- #valid? ⇒ Boolean
Constructor Details
#initialize(log_line) ⇒ LocalPullRequest
Returns a new instance of LocalPullRequest.
7 8 9 10 |
# File 'lib/danger/ci_source/support/local_pull_request.rb', line 7 def initialize(log_line) @pull_request_id = log_line.match(/#(?<id>[0-9]+)/)[:id] @sha = log_line.split(" ").first end |
Instance Attribute Details
#pull_request_id ⇒ Object (readonly)
Returns the value of attribute pull_request_id.
5 6 7 |
# File 'lib/danger/ci_source/support/local_pull_request.rb', line 5 def pull_request_id @pull_request_id end |
#sha ⇒ Object (readonly)
Returns the value of attribute sha.
5 6 7 |
# File 'lib/danger/ci_source/support/local_pull_request.rb', line 5 def sha @sha end |
Instance Method Details
#valid? ⇒ Boolean
12 13 14 |
# File 'lib/danger/ci_source/support/local_pull_request.rb', line 12 def valid? pull_request_id && sha end |