gitlab-org--gitlab-foss/lib/bitbucket/representation/pull_request_comment.rb
2016-12-12 20:41:55 +02:00

39 lines
576 B
Ruby

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.dig('parent', 'id')
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