gitlab-org--gitlab-foss/lib/github/representation/issue.rb
Rémy Coutable a5850041d3
Minor improvements after latest review
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-10-05 12:45:15 +02:00

27 lines
538 B
Ruby

module Github
module Representation
class Issue < Representation::Issuable
def state
raw['state'] == 'closed' ? 'closed' : 'opened'
end
def comments?
raw['comments'] > 0
end
def pull_request?
raw['pull_request'].present?
end
def assigned?
raw['assignees'].present?
end
def assignees
@assignees ||= Array(raw['assignees']).map do |user|
Github::Representation::User.new(user, options)
end
end
end
end
end