comment.rb 468 Bytes
Newer Older
1 2
# frozen_string_literal: true

3 4 5 6
module Bitbucket
  module Representation
    class Comment < Representation::Base
      def author
7
        user['username']
8 9 10
      end

      def note
11
        raw.fetch('content', {}).fetch('raw', nil)
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
      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