BigW Consortium Gitlab

pull_request_comment.rb 585 Bytes
Newer Older
Stan Hu committed
1 2 3 4 5 6 7 8
module Bitbucket
  module Representation
    class PullRequestComment < Comment
      def iid
        raw['id']
      end

      def file_path
9
        inline.fetch('path')
Stan Hu committed
10 11 12
      end

      def old_pos
13
        inline.fetch('from')
Stan Hu committed
14 15 16
      end

      def new_pos
17
        inline.fetch('to')
Stan Hu committed
18 19 20
      end

      def parent_id
21
        raw.fetch('parent', {}).fetch('id', nil)
Stan Hu committed
22 23 24
      end

      def inline?
25
        raw.key?('inline')
Stan Hu committed
26 27 28
      end

      def has_parent?
29
        raw.key?('parent')
Stan Hu committed
30 31 32 33 34 35 36 37 38 39
      end

      private

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