Class: BitbucketServer::Representation::PullRequest
- Inherits:
-
Base
- Object
- Base
- BitbucketServer::Representation::PullRequest
show all
- Defined in:
- lib/bitbucket_server/representation/pull_request.rb
Instance Attribute Summary
Attributes inherited from Base
#raw
Instance Method Summary
collapse
Methods inherited from Base
convert_timestamp, decorate, #initialize
Instance Method Details
#author ⇒ Object
6
7
8
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 6
def author
raw.dig('author', 'user', 'name')
end
|
#author_email ⇒ Object
10
11
12
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 10
def author_email
raw.dig('author', 'user', 'emailAddress')
end
|
#created_at ⇒ Object
37
38
39
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 37
def created_at
self.class.convert_timestamp(created_date)
end
|
#description ⇒ Object
14
15
16
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 14
def description
raw['description']
end
|
#iid ⇒ Object
18
19
20
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 18
def iid
raw['id']
end
|
#merged? ⇒ Boolean
33
34
35
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 33
def merged?
state == 'merged'
end
|
#source_branch_name ⇒ Object
49
50
51
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 49
def source_branch_name
raw.dig('fromRef', 'id')
end
|
#source_branch_sha ⇒ Object
53
54
55
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 53
def source_branch_sha
raw.dig('fromRef', 'latestCommit')
end
|
#state ⇒ Object
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 22
def state
case raw['state']
when 'MERGED'
'merged'
when 'DECLINED'
'closed'
else
'opened'
end
end
|
#target_branch_name ⇒ Object
57
58
59
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 57
def target_branch_name
raw.dig('toRef', 'id')
end
|
#target_branch_sha ⇒ Object
61
62
63
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 61
def target_branch_sha
raw.dig('toRef', 'latestCommit')
end
|
#title ⇒ Object
45
46
47
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 45
def title
raw['title']
end
|
#updated_at ⇒ Object
41
42
43
|
# File 'lib/bitbucket_server/representation/pull_request.rb', line 41
def updated_at
self.class.convert_timestamp(updated_date)
end
|