Class: BitbucketServer::Representation::Activity
- Inherits:
-
Base
- Object
- Base
- BitbucketServer::Representation::Activity
show all
- Defined in:
- lib/bitbucket_server/representation/activity.rb
Instance Attribute Summary
Attributes inherited from Base
#raw
Instance Method Summary
collapse
Methods inherited from Base
convert_timestamp, decorate, #initialize
Instance Method Details
14
15
16
17
18
19
20
21
22
23
|
# File 'lib/bitbucket_server/representation/activity.rb', line 14
def
return unless
@comment ||=
if
PullRequestComment.new(raw)
else
Comment.new(raw)
end
end
|
6
7
8
|
# File 'lib/bitbucket_server/representation/activity.rb', line 6
def
action == 'COMMENTED'
end
|
#committer_email ⇒ Object
34
35
36
|
# File 'lib/bitbucket_server/representation/activity.rb', line 34
def committer_email
commit.dig('committer', 'emailAddress')
end
|
#committer_user ⇒ Object
30
31
32
|
# File 'lib/bitbucket_server/representation/activity.rb', line 30
def committer_user
commit.dig('committer', 'displayName')
end
|
#created_at ⇒ Object
48
49
50
|
# File 'lib/bitbucket_server/representation/activity.rb', line 48
def created_at
self.class.convert_timestamp(created_date)
end
|
10
11
12
|
# File 'lib/bitbucket_server/representation/activity.rb', line 10
def
!!( && )
end
|
#merge_commit ⇒ Object
44
45
46
|
# File 'lib/bitbucket_server/representation/activity.rb', line 44
def merge_commit
commit['id']
end
|
#merge_event? ⇒ Boolean
TODO Move this into MergeEvent
26
27
28
|
# File 'lib/bitbucket_server/representation/activity.rb', line 26
def merge_event?
action == 'MERGED'
end
|
#merge_timestamp ⇒ Object
38
39
40
41
42
|
# File 'lib/bitbucket_server/representation/activity.rb', line 38
def merge_timestamp
timestamp = commit['committerTimestamp']
self.class.convert_timestamp(timestamp)
end
|