Class: Bitbucket::Representation::Issue
- Inherits:
-
Base
- Object
- Base
- Bitbucket::Representation::Issue
show all
- Defined in:
- lib/bitbucket/representation/issue.rb
Constant Summary
collapse
- CLOSED_STATUS =
%w[resolved invalid duplicate wontfix closed].freeze
Instance Attribute Summary
Attributes inherited from Base
#raw
Instance Method Summary
collapse
Methods inherited from Base
decorate, #initialize
Instance Method Details
#author ⇒ Object
16
17
18
|
# File 'lib/bitbucket/representation/issue.rb', line 16
def author
raw.dig('reporter', 'uuid')
end
|
#author_nickname ⇒ Object
20
21
22
|
# File 'lib/bitbucket/representation/issue.rb', line 20
def author_nickname
raw.dig('reporter', 'nickname')
end
|
#created_at ⇒ Object
40
41
42
|
# File 'lib/bitbucket/representation/issue.rb', line 40
def created_at
raw['created_on']
end
|
#description ⇒ Object
24
25
26
|
# File 'lib/bitbucket/representation/issue.rb', line 24
def description
raw.fetch('content', {}).fetch('raw', nil)
end
|
#iid ⇒ Object
8
9
10
|
# File 'lib/bitbucket/representation/issue.rb', line 8
def iid
raw['id']
end
|
#kind ⇒ Object
12
13
14
|
# File 'lib/bitbucket/representation/issue.rb', line 12
def kind
raw['kind']
end
|
#milestone ⇒ Object
36
37
38
|
# File 'lib/bitbucket/representation/issue.rb', line 36
def milestone
raw['milestone']['name'] if raw['milestone'].present?
end
|
#state ⇒ Object
28
29
30
|
# File 'lib/bitbucket/representation/issue.rb', line 28
def state
closed? ? 'closed' : 'opened'
end
|
#title ⇒ Object
32
33
34
|
# File 'lib/bitbucket/representation/issue.rb', line 32
def title
raw['title']
end
|
#to_hash ⇒ Object
52
53
54
55
56
57
58
59
60
61
62
63
64
|
# File 'lib/bitbucket/representation/issue.rb', line 52
def to_hash
{
iid: iid,
title: title,
description: description,
state: state,
author: author,
author_nickname: author_nickname,
milestone: milestone,
created_at: created_at,
updated_at: updated_at
}
end
|
#to_s ⇒ Object
48
49
50
|
# File 'lib/bitbucket/representation/issue.rb', line 48
def to_s
iid
end
|
#updated_at ⇒ Object
44
45
46
|
# File 'lib/bitbucket/representation/issue.rb', line 44
def updated_at
raw['edited_on']
end
|