Class: TranscriptViewer::Page
- Inherits:
-
Object
- Object
- TranscriptViewer::Page
- Defined in:
- lib/transcript_viewer/page.rb
Instance Method Summary collapse
- #app_html ⇒ Object
-
#initialize(session_id:, events:, forked_transcript: false, ancestor_lookup: nil, export_href: nil, forked_transcript_href: nil, hide_forked_transcript_href: nil, asset_dir: nil, template_dir: nil, tool_templates: nil, before_html: nil, after_html: nil) ⇒ Page
constructor
A new instance of Page.
- #javascript ⇒ Object
- #render ⇒ Object
- #stylesheet ⇒ Object
Constructor Details
#initialize(session_id:, events:, forked_transcript: false, ancestor_lookup: nil, export_href: nil, forked_transcript_href: nil, hide_forked_transcript_href: nil, asset_dir: nil, template_dir: nil, tool_templates: nil, before_html: nil, after_html: nil) ⇒ Page
Returns a new instance of Page.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/transcript_viewer/page.rb', line 5 def initialize(session_id:, events:, forked_transcript: false, ancestor_lookup: nil, export_href: nil, forked_transcript_href: nil, hide_forked_transcript_href: nil, asset_dir: nil, template_dir: nil, tool_templates: nil, before_html: nil, after_html: nil) view = View.new( session_id: session_id, events: events, forked_transcript: forked_transcript, ancestor_lookup: ancestor_lookup, export_href: export_href, forked_transcript_href: forked_transcript_href, hide_forked_transcript_href: hide_forked_transcript_href, asset_dir: asset_dir, ).to_h view[:before_html] = before_html.to_s view[:after_html] = after_html.to_s registered_tool_templates = TranscriptViewer.configuration.tool_templates.merge(tool_templates) @renderer = Renderer.new( view, template_dir: template_dir, tool_templates: registered_tool_templates, ) end |
Instance Method Details
#app_html ⇒ Object
34 35 36 |
# File 'lib/transcript_viewer/page.rb', line 34 def app_html @renderer.render_app end |
#javascript ⇒ Object
38 39 40 |
# File 'lib/transcript_viewer/page.rb', line 38 def javascript @renderer.render_javascript end |
#render ⇒ Object
26 27 28 |
# File 'lib/transcript_viewer/page.rb', line 26 def render @renderer.render end |
#stylesheet ⇒ Object
30 31 32 |
# File 'lib/transcript_viewer/page.rb', line 30 def stylesheet @renderer.stylesheet end |