Class: Aid::Scripts::Review::PullRequest
- Inherits:
-
Object
- Object
- Aid::Scripts::Review::PullRequest
- Defined in:
- lib/aid/scripts/review.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
-
#initialize(id:, title:, repo_name:) ⇒ PullRequest
constructor
A new instance of PullRequest.
-
#mark_ready_for_review! ⇒ Object
rubocop:disable Metrics/MethodLength.
Constructor Details
#initialize(id:, title:, repo_name:) ⇒ PullRequest
Returns a new instance of PullRequest.
278 279 280 281 282 |
# File 'lib/aid/scripts/review.rb', line 278 def initialize(id:, title:, repo_name:) @id = id @title = title @url = "https://github.com/#{repo_name}/pull/#{id}" end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
276 277 278 |
# File 'lib/aid/scripts/review.rb', line 276 def id @id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
276 277 278 |
# File 'lib/aid/scripts/review.rb', line 276 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
276 277 278 |
# File 'lib/aid/scripts/review.rb', line 276 def url @url end |
Instance Method Details
#mark_ready_for_review! ⇒ Object
rubocop:disable Metrics/MethodLength
285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 |
# File 'lib/aid/scripts/review.rb', line 285 def mark_ready_for_review! cmd = <<~CMD hub api graphql \ -H "Accept: application/vnd.github.shadow-cat-preview+json" \ -f query=' mutation MarkPullRequestReady { markPullRequestReadyForReview( input: { pullRequestId:"#{graphql_id}" } ) { pullRequest { isDraft number } } } ' CMD `#{cmd}` end |