Class: PdkSync::PullRequest
- Inherits:
-
Object
- Object
- PdkSync::PullRequest
- Defined in:
- lib/pdksync/pullrequest.rb
Instance Attribute Summary collapse
-
#html_url ⇒ Object
readonly
Returns the value of attribute html_url.
-
#number ⇒ Object
readonly
Returns the value of attribute number.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(pr_object, git_platform = :github) ⇒ PullRequest
constructor
Create a new PR wrapper object setting html_url and number.
Constructor Details
#initialize(pr_object, git_platform = :github) ⇒ PullRequest
Create a new PR wrapper object setting html_url and number
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/pdksync/pullrequest.rb', line 25 def initialize(pr_object, git_platform = :github) case git_platform when :github @html_url = pr_object.html_url @number = pr_object.number when :gitlab @html_url = pr_object.web_url @number = pr_object.iid end end |
Instance Attribute Details
#html_url ⇒ Object (readonly)
Returns the value of attribute html_url.
17 18 19 |
# File 'lib/pdksync/pullrequest.rb', line 17 def html_url @html_url end |
#number ⇒ Object (readonly)
Returns the value of attribute number.
17 18 19 |
# File 'lib/pdksync/pullrequest.rb', line 17 def number @number end |
Class Method Details
.github(pr_object) ⇒ Object
6 7 8 |
# File 'lib/pdksync/pullrequest.rb', line 6 def github(pr_object) new(pr_object) end |
.gitlab(pr_object) ⇒ Object
10 11 12 |
# File 'lib/pdksync/pullrequest.rb', line 10 def gitlab(pr_object) new(pr_object, :gitlab) end |