gitlab-org--gitlab-foss/lib/bitbucket/representation/pull_request_comment.rb

40 lines
576 B
Ruby
Raw Normal View History

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-07 04:33:32 -05:00
raw.dig('parent', 'id')
2016-11-16 03:13:17 -05:00
end
def inline?
raw.has_key?('inline')
end
def has_parent?
raw.has_key?('parent')
end
private
def inline
raw.fetch('inline', {})
end
end
end
end