Class: PullRequest

Inherits:
Object
  • Object
show all
Defined in:
lib/prophet/pull_request.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#commentObject

Returns the value of attribute comment.



3
4
5
# File 'lib/prophet/pull_request.rb', line 3

def comment
  @comment
end

#contentObject

Returns the value of attribute content.



3
4
5
# File 'lib/prophet/pull_request.rb', line 3

def content
  @content
end

#from_forkObject

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_shaObject

Returns the value of attribute head_sha.



3
4
5
# File 'lib/prophet/pull_request.rb', line 3

def head_sha
  @head_sha
end

#idObject

Returns the value of attribute id.



3
4
5
# File 'lib/prophet/pull_request.rb', line 3

def id
  @id
end

#target_head_shaObject

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

#wipObject

Returns the value of attribute wip.



3
4
5
# File 'lib/prophet/pull_request.rb', line 3

def wip
  @wip
end