Class: PullRequest
- Inherits:
-
Object
- Object
- PullRequest
- Defined in:
- lib/prophet/pull_request.rb
Instance Attribute Summary collapse
-
#comment ⇒ Object
Returns the value of attribute comment.
-
#content ⇒ Object
Returns the value of attribute content.
-
#from_fork ⇒ Object
Returns the value of attribute from_fork.
-
#head_sha ⇒ Object
Returns the value of attribute head_sha.
-
#id ⇒ Object
Returns the value of attribute id.
-
#target_head_sha ⇒ Object
Returns the value of attribute target_head_sha.
-
#wip ⇒ Object
Returns the value of attribute wip.
Instance Method Summary collapse
-
#initialize(content) ⇒ PullRequest
constructor
A new instance of PullRequest.
Constructor Details
#initialize(content) ⇒ PullRequest
Returns a new instance of PullRequest.
11 12 13 14 15 16 17 |
# File 'lib/prophet/pull_request.rb', line 11 def initialize(content) @content = content @id = content.number @head_sha = content.head.sha @from_fork = content.head.attrs[:repo].attrs[:fork] if content.head.attrs[:repo] @wip = content.labels.map(&:name).map(&:downcase).include? 'wip' end |
Instance Attribute Details
#comment ⇒ Object
Returns the value of attribute comment.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def comment @comment end |
#content ⇒ Object
Returns the value of attribute content.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def content @content end |
#from_fork ⇒ Object
Returns the value of attribute from_fork.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def from_fork @from_fork end |
#head_sha ⇒ Object
Returns the value of attribute head_sha.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def head_sha @head_sha end |
#id ⇒ Object
Returns the value of attribute id.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def id @id end |
#target_head_sha ⇒ Object
Returns the value of attribute target_head_sha.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def target_head_sha @target_head_sha end |
#wip ⇒ Object
Returns the value of attribute wip.
3 4 5 |
# File 'lib/prophet/pull_request.rb', line 3 def wip @wip end |