diff_line_entity.rb 346 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11
# frozen_string_literal: true

class DiffLineEntity < Grape::Entity
  expose :line_code
  expose :type
  expose :old_line
  expose :new_line
  expose :text
  expose :meta_positions, as: :meta_data

  expose :rich_text do |line|
12
    ERB::Util.html_escape(line.rich_text || line.text)
13
  end
14 15

  expose :suggestible?, as: :can_receive_suggestion
16
end