2017-04-12 21:41:58 -04:00
|
|
|
module Github
|
|
|
|
module Representation
|
2017-04-19 18:17:42 -04:00
|
|
|
class Issue < Representation::Issuable
|
2017-04-13 17:21:03 -04:00
|
|
|
def labels
|
|
|
|
raw['labels']
|
|
|
|
end
|
|
|
|
|
2017-04-12 21:41:58 -04:00
|
|
|
def state
|
|
|
|
raw['state'] == 'closed' ? 'closed' : 'opened'
|
|
|
|
end
|
|
|
|
|
2017-04-13 16:31:29 -04:00
|
|
|
def has_comments?
|
|
|
|
raw['comments'] > 0
|
|
|
|
end
|
|
|
|
|
2017-04-13 17:21:03 -04:00
|
|
|
def has_labels?
|
|
|
|
labels.count > 0
|
|
|
|
end
|
|
|
|
|
2017-04-12 21:41:58 -04:00
|
|
|
def pull_request?
|
|
|
|
raw['pull_request'].present?
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|