Class: Agent::SessionContext::Renderers::Markdown

Inherits:
Object
  • Object
show all
Defined in:
lib/agent/session_context/renderers/markdown.rb

Instance Method Summary collapse

Instance Method Details

#call(value) ⇒ Object



21
22
23
24
25
26
27
28
29
30
31
# File 'lib/agent/session_context/renderers/markdown.rb', line 21

def call(value)
  # Same reason as Renderers::Text#call: render the Loop directly so
  # its raw on-disk records never pass through the generic Serializer.
  return LoopView.new(value).markdown.chomp if value.is_a?(Loop)

  if value.is_a?(Snapshot)
    render_snapshot(value)
  else
    render_prompts(Array(value))
  end
end