Class: Sentiero::Web::Views::HeatmapView

Inherits:
BaseView
  • Object
show all
Defined in:
lib/sentiero/web/views/heatmap_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

Attributes inherited from BaseView

#base_path, #csrf_token

Instance Method Summary collapse

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(urls:, selected_url:, was_truncated:, config_json:, since:, until_str:) ⇒ HeatmapView

Returns a new instance of HeatmapView.



10
11
12
13
14
15
16
17
18
# File 'lib/sentiero/web/views/heatmap_view.rb', line 10

def initialize(urls:, selected_url:, was_truncated:, config_json:, since:, until_str:)
  super()
  @urls = urls
  @selected_url = selected_url
  @was_truncated = was_truncated
  @config_json = config_json
  @since = since
  @until_str = until_str
end

Instance Attribute Details

#config_jsonObject (readonly)

Returns the value of attribute config_json.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def config_json
  @config_json
end

#selected_urlObject (readonly)

Returns the value of attribute selected_url.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def selected_url
  @selected_url
end

#sinceObject (readonly)

Returns the value of attribute since.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def since
  @since
end

#until_strObject (readonly)

Returns the value of attribute until_str.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def until_str
  @until_str
end

#urlsObject (readonly)

Returns the value of attribute urls.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def urls
  @urls
end

#was_truncatedObject (readonly)

Returns the value of attribute was_truncated.



20
21
22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 20

def was_truncated
  @was_truncated
end

Instance Method Details

#page_report_hrefObject

Query holds server-side strings only; escaped at the h.call sink.



25
26
27
28
29
30
# File 'lib/sentiero/web/views/heatmap_view.rb', line 25

def page_report_href
  q = {}
  q["url"] = selected_url if selected_url && !selected_url.to_s.empty?
  q.merge!(range_pairs)
  "#{base_path}/analytics/page" + (q.empty? ? "" : "?" + Rack::Utils.build_query(q))
end

#templateObject



22
# File 'lib/sentiero/web/views/heatmap_view.rb', line 22

def template = "heatmap.html.erb"