2018-10-06 19:10:08 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
2016-08-22 15:10:29 -04:00
|
|
|
module Bitbucket
|
|
|
|
module Representation
|
|
|
|
class Comment < Representation::Base
|
|
|
|
def author
|
2016-12-14 05:35:10 -05:00
|
|
|
user['username']
|
2016-08-22 15:10:29 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def note
|
2016-12-16 16:51:40 -05:00
|
|
|
raw.fetch('content', {}).fetch('raw', nil)
|
2016-08-22 15:10:29 -04:00
|
|
|
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
|