summaryrefslogtreecommitdiff
path: root/lib/bitbucket/representation/comment.rb
blob: bc40f891cd36e227a249b7b12a072664acac3785 (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_representation(user)
      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