2016-11-16 03:13:17 -05:00
|
|
|
module Bitbucket
|
|
|
|
module Representation
|
|
|
|
class PullRequestComment < Comment
|
|
|
|
def iid
|
|
|
|
raw['id']
|
|
|
|
end
|
|
|
|
|
|
|
|
def file_path
|
2016-12-12 13:41:55 -05:00
|
|
|
inline.fetch('path')
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def old_pos
|
2016-12-12 13:41:55 -05:00
|
|
|
inline.fetch('from')
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def new_pos
|
2016-12-12 13:41:55 -05:00
|
|
|
inline.fetch('to')
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def parent_id
|
2016-12-16 16:51:40 -05:00
|
|
|
raw.fetch('parent', {}).fetch('id', nil)
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def inline?
|
2017-06-02 13:11:26 -04:00
|
|
|
raw.key?('inline')
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
def has_parent?
|
2017-06-02 13:11:26 -04:00
|
|
|
raw.key?('parent')
|
2016-11-16 03:13:17 -05:00
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
def inline
|
|
|
|
raw.fetch('inline', {})
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|