gitlab-org--gitlab-foss/lib/bitbucket/representation/pull_request_comment.rb
Rémy Coutable 4cfa5ce4a9
Enable the Style/PreferredHashMethods cop
Signed-off-by: Rémy Coutable <remy@rymai.me>
2017-06-02 19:11:26 +02:00

39 lines
585 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.fetch('parent', {}).fetch('id', nil)
end
def inline?
raw.key?('inline')
end
def has_parent?
raw.key?('parent')
end
private
def inline
raw.fetch('inline', {})
end
end
end
end