summaryrefslogtreecommitdiff
path: root/lib/bitbucket/representation/comment.rb
blob: 127598a76ab8a774459bff0c7654caef68971c7b (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
28
29
# frozen_string_literal: true

module Bitbucket
  module Representation
    class Comment < Representation::Base
      def author
        user['nickname']
      end

      def note
        raw.fetch('content', {}).fetch('raw', nil)
      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