summaryrefslogtreecommitdiff
path: root/lib/github/representation/issue.rb
blob: df3540a6e6c5d1b8fee962ee2efacc49a7595c95 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
module Github
  module Representation
    class Issue < Representation::Issuable
      def labels
        raw['labels']
      end

      def state
        raw['state'] == 'closed' ? 'closed' : 'opened'
      end

      def has_comments?
        raw['comments'] > 0
      end

      def has_labels?
        labels.count > 0
      end

      def pull_request?
        raw['pull_request'].present?
      end
    end
  end
end