Class: Sentiero::Web::Views::PageReportView
- Defined in:
- lib/sentiero/web/views/page_report_view.rb
Constant Summary
Constants inherited from BaseView
BaseView::TEMPLATES_DIR, BaseView::TEMPLATE_CACHE
Constants included from Escaping
Escaping::HTML_UNSAFE_IN_SCRIPT, Escaping::HTML_UNSAFE_IN_SCRIPT_PATTERN
Instance Attribute Summary collapse
-
#report ⇒ Object
readonly
Returns the value of attribute report.
-
#selected_url ⇒ Object
readonly
Returns the value of attribute selected_url.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#until_str ⇒ Object
readonly
Returns the value of attribute until_str.
-
#urls ⇒ Object
readonly
Returns the value of attribute urls.
-
#was_truncated ⇒ Object
readonly
Returns the value of attribute was_truncated.
Attributes inherited from BaseView
Instance Method Summary collapse
- #entry_exit ⇒ Object
- #forms ⇒ Object
- #frustration ⇒ Object
- #heatmap_href ⇒ Object
-
#initialize(report:, urls:, selected_url:, was_truncated:, since:, until_str:) ⇒ PageReportView
constructor
A new instance of PageReportView.
- #pct(rate) ⇒ Object
- #scroll ⇒ Object
- #secs(ms) ⇒ Object
- #template ⇒ Object
- #time_on_page ⇒ Object
Methods inherited from BaseView
#built_asset, compiled_template, #escape_js, #h, #range_pairs, #render, #render_layout, #render_partial, #render_session_row
Methods included from Formatting
#format_duration, #format_vital, #parse_browser, #parse_device
Methods included from Escaping
#escape_html, #escape_js_string, #escape_json
Constructor Details
#initialize(report:, urls:, selected_url:, was_truncated:, since:, until_str:) ⇒ PageReportView
Returns a new instance of PageReportView.
10 11 12 13 14 15 16 17 18 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 10 def initialize(report:, urls:, selected_url:, was_truncated:, since:, until_str:) super() @report = report @urls = urls @selected_url = selected_url @was_truncated = was_truncated @since = since @until_str = until_str end |
Instance Attribute Details
#report ⇒ Object (readonly)
Returns the value of attribute report.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def report @report end |
#selected_url ⇒ Object (readonly)
Returns the value of attribute selected_url.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def selected_url @selected_url end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def since @since end |
#until_str ⇒ Object (readonly)
Returns the value of attribute until_str.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def until_str @until_str end |
#urls ⇒ Object (readonly)
Returns the value of attribute urls.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def urls @urls end |
#was_truncated ⇒ Object (readonly)
Returns the value of attribute was_truncated.
20 21 22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 20 def was_truncated @was_truncated end |
Instance Method Details
#entry_exit ⇒ Object
36 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 36 def entry_exit = report[:entry_exit] |
#forms ⇒ Object
38 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 38 def forms = report[:forms] |
#frustration ⇒ Object
39 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 39 def frustration = report[:frustration] |
#heatmap_href ⇒ Object
28 29 30 31 32 33 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 28 def heatmap_href q = {} q["url"] = selected_url if selected_url && !selected_url.to_s.empty? q.merge!(range_pairs) "#{base_path}/analytics/heatmap" + (q.empty? ? "" : "?" + Rack::Utils.build_query(q)) end |
#pct(rate) ⇒ Object
26 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 26 def pct(rate) = "#{(rate * 100).round(1)}%" |
#scroll ⇒ Object
37 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 37 def scroll = report[:scroll] |
#secs(ms) ⇒ Object
24 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 24 def secs(ms) = ms ? "#{(ms / 1000.0).round(1)}s" : "—" |
#template ⇒ Object
22 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 22 def template = "analytics_page.html.erb" |
#time_on_page ⇒ Object
35 |
# File 'lib/sentiero/web/views/page_report_view.rb', line 35 def time_on_page = report[:time_on_page] |