Class: RubocopPr::Repositories::Github::PullRequest
- Inherits:
-
Object
- Object
- RubocopPr::Repositories::Github::PullRequest
- Defined in:
- lib/rubocop_pr/repositories/github.rb
Overview
The representation of the PR
Instance Attribute Summary collapse
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
- #create ⇒ Object
-
#initialize(title:, **other) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(title:, **other) ⇒ PullRequest
Returns a new instance of PullRequest.
29 30 31 32 |
# File 'lib/rubocop_pr/repositories/github.rb', line 29 def initialize(title:, **other) @title = title @body = other[:body] || '' end |
Instance Attribute Details
#body ⇒ Object (readonly)
Returns the value of attribute body.
27 28 29 |
# File 'lib/rubocop_pr/repositories/github.rb', line 27 def body @body end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
27 28 29 |
# File 'lib/rubocop_pr/repositories/github.rb', line 27 def title @title end |
Instance Method Details
#create ⇒ Object
34 35 36 37 |
# File 'lib/rubocop_pr/repositories/github.rb', line 34 def create link = `hub pull-request create -m '#{title}' -m '#{body}'` link.split('/').last.to_i end |