Class: Bitbucket::Representation::PullRequest
- Inherits:
-
Base
- Object
- Base
- Bitbucket::Representation::PullRequest
show all
- Defined in:
- lib/bitbucket/representation/pull_request.rb
Instance Attribute Summary
Attributes inherited from Base
#raw
Instance Method Summary
collapse
Methods inherited from Base
decorate, #initialize
Instance Method Details
#author ⇒ Object
6
7
8
|
# File 'lib/bitbucket/representation/pull_request.rb', line 6
def author
raw.fetch('author', {}).fetch('nickname', nil)
end
|
#created_at ⇒ Object
29
30
31
|
# File 'lib/bitbucket/representation/pull_request.rb', line 29
def created_at
raw['created_on']
end
|
#description ⇒ Object
10
11
12
|
# File 'lib/bitbucket/representation/pull_request.rb', line 10
def description
raw['description']
end
|
#iid ⇒ Object
14
15
16
|
# File 'lib/bitbucket/representation/pull_request.rb', line 14
def iid
raw['id']
end
|
#source_branch_name ⇒ Object
41
42
43
|
# File 'lib/bitbucket/representation/pull_request.rb', line 41
def source_branch_name
source_branch.fetch('branch', {}).fetch('name', nil)
end
|
#source_branch_sha ⇒ Object
45
46
47
|
# File 'lib/bitbucket/representation/pull_request.rb', line 45
def source_branch_sha
source_branch.fetch('commit', {}).fetch('hash', nil)
end
|
#state ⇒ Object
18
19
20
21
22
23
24
25
26
27
|
# File 'lib/bitbucket/representation/pull_request.rb', line 18
def state
case raw['state']
when 'MERGED'
'merged'
when 'DECLINED', 'SUPERSEDED'
'closed'
else
'opened'
end
end
|
#target_branch_name ⇒ Object
49
50
51
|
# File 'lib/bitbucket/representation/pull_request.rb', line 49
def target_branch_name
target_branch.fetch('branch', {}).fetch('name', nil)
end
|
#target_branch_sha ⇒ Object
53
54
55
|
# File 'lib/bitbucket/representation/pull_request.rb', line 53
def target_branch_sha
target_branch.fetch('commit', {}).fetch('hash', nil)
end
|
#title ⇒ Object
37
38
39
|
# File 'lib/bitbucket/representation/pull_request.rb', line 37
def title
raw['title']
end
|
#updated_at ⇒ Object
33
34
35
|
# File 'lib/bitbucket/representation/pull_request.rb', line 33
def updated_at
raw['updated_on']
end
|