Class: OctoMerge::PullRequest

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repo:, number:) ⇒ PullRequest

Returns a new instance of PullRequest.



7
8
9
10
# File 'lib/octo_merge/pull_request.rb', line 7

def initialize(repo:, number:)
  @repo = repo
  @number = number.to_s
end

Instance Attribute Details

#numberObject (readonly)

Returns the value of attribute number.



5
6
7
# File 'lib/octo_merge/pull_request.rb', line 5

def number
  @number
end

#repoObject (readonly)

Returns the value of attribute repo.



5
6
7
# File 'lib/octo_merge/pull_request.rb', line 5

def repo
  @repo
end

Instance Method Details

#==(other_pull_request) ⇒ Object



24
25
26
# File 'lib/octo_merge/pull_request.rb', line 24

def ==(other_pull_request)
  repo == other_pull_request.repo && number == other_pull_request.number
end

#branchObject



20
21
22
# File 'lib/octo_merge/pull_request.rb', line 20

def branch
  github_api_result.head.ref
end

#remoteObject



12
13
14
# File 'lib/octo_merge/pull_request.rb', line 12

def remote
  github_api_result.user.
end

#remote_urlObject



16
17
18
# File 'lib/octo_merge/pull_request.rb', line 16

def remote_url
  github_api_result.head.repo.ssh_url
end