Class: Aid::Scripts::Review::PullRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/aid/scripts/review.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(id:, title:, repo_name:) ⇒ 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

#idObject (readonly)

Returns the value of attribute id.



276
277
278
# File 'lib/aid/scripts/review.rb', line 276

def id
  @id
end

#titleObject (readonly)

Returns the value of attribute title.



276
277
278
# File 'lib/aid/scripts/review.rb', line 276

def title
  @title
end

#urlObject (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 = "    hub api graphql \\\n      -H \"Accept: application/vnd.github.shadow-cat-preview+json\" \\\n      -f query='\n        mutation MarkPullRequestReady {\n          markPullRequestReadyForReview(\n            input: {\n              pullRequestId:\"\#{graphql_id}\"\n            }\n          ) {\n            pullRequest {\n              isDraft\n              number\n            }\n          }\n        }\n      '\n  CMD\n\n  `\#{cmd}`\nend\n"