Class: BlobViewer::Markup

Inherits:
Base
  • Object
show all
Includes:
Rich, ServerSide
Defined in:
app/models/blob_viewer/markup.rb

Constant Summary

Constants inherited from Base

Base::PARTIAL_PATH_PREFIX

Instance Attribute Summary

Attributes inherited from Base

#blob

Instance Method Summary collapse

Methods included from ServerSide

#prepare!, #render_error

Methods inherited from Base

auxiliary?, binary?, #binary_detected_after_load?, can_render?, #collapsed?, #initialize, load_async?, loading_partial_path, partial_path, #prepare!, #render_error, rich?, simple?, text?, #too_large?

Constructor Details

This class inherits a constructor from BlobViewer::Base

Instance Method Details

#banzai_render_contextObject


13
14
15
16
17
18
19
# File 'app/models/blob_viewer/markup.rb', line 13

def banzai_render_context
  {}.tap do |h|
    h[:rendered] = blob.rendered_markup if blob.respond_to?(:rendered_markup)

    h[:cache_key] = ['blob', blob.id, 'commit', blob.commit_id]
  end
end