summaryrefslogtreecommitdiff
path: root/lib/bitbucket/representation/comment.rb
blob: 3c75e9368faa7c738ff9f500673601321140dfd5 (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
26
27
module Bitbucket
  module Representation
    class Comment < Representation::Base
      def author
        user['username']
      end

      def note
        raw.dig('content', 'raw')
      end

      def created_at
        raw['created_on']
      end

      def updated_at
        raw['updated_on'] || raw['created_on']
      end

      private

      def user
        raw.fetch('user', {})
      end
    end
  end
end