2017-08-17 22:00:37 +05:30
|
|
|
module Bitbucket
|
|
|
|
module Representation
|
|
|
|
class PullRequestComment < Comment
|
|
|
|
def iid
|
|
|
|
raw['id']
|
|
|
|
end
|
|
|
|
|
|
|
|
def file_path
|
|
|
|
inline.fetch('path')
|
|
|
|
end
|
|
|
|
|
|
|
|
def old_pos
|
|
|
|
inline.fetch('from')
|
|
|
|
end
|
|
|
|
|
|
|
|
def new_pos
|
|
|
|
inline.fetch('to')
|
|
|
|
end
|
|
|
|
|
|
|
|
def parent_id
|
|
|
|
raw.fetch('parent', {}).fetch('id', nil)
|
|
|
|
end
|
|
|
|
|
|
|
|
def inline?
|
2017-09-10 17:25:29 +05:30
|
|
|
raw.key?('inline')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
def has_parent?
|
2017-09-10 17:25:29 +05:30
|
|
|
raw.key?('parent')
|
2017-08-17 22:00:37 +05:30
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def inline
|
|
|
|
raw.fetch('inline', {})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|