Class: Sentiero::Web::Views::FunnelView
- Defined in:
- lib/sentiero/web/views/funnel_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
-
#selected_steps ⇒ Object
readonly
Returns the value of attribute selected_steps.
-
#since ⇒ Object
readonly
Returns the value of attribute since.
-
#steps ⇒ Object
readonly
Returns the value of attribute steps.
-
#tags ⇒ Object
readonly
Returns the value of attribute tags.
-
#until_str ⇒ Object
readonly
Returns the value of attribute until_str.
-
#was_truncated ⇒ Object
readonly
Returns the value of attribute was_truncated.
Attributes inherited from BaseView
Instance Method Summary collapse
- #dropped(i) ⇒ Object
- #format_gap(ms) ⇒ Object
-
#initialize(tags:, selected_steps:, steps:, was_truncated:, since:, until_str:) ⇒ FunnelView
constructor
A new instance of FunnelView.
- #next_step(i) ⇒ Object
- #step_one_sessions ⇒ Object
- #template ⇒ 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(tags:, selected_steps:, steps:, was_truncated:, since:, until_str:) ⇒ FunnelView
Returns a new instance of FunnelView.
9 10 11 12 13 14 15 16 17 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 9 def initialize(tags:, selected_steps:, steps:, was_truncated:, since:, until_str:) super() @tags = @selected_steps = selected_steps @steps = steps @was_truncated = was_truncated @since = since @until_str = until_str end |
Instance Attribute Details
#selected_steps ⇒ Object (readonly)
Returns the value of attribute selected_steps.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def selected_steps @selected_steps end |
#since ⇒ Object (readonly)
Returns the value of attribute since.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def since @since end |
#steps ⇒ Object (readonly)
Returns the value of attribute steps.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def steps @steps end |
#tags ⇒ Object (readonly)
Returns the value of attribute tags.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def @tags end |
#until_str ⇒ Object (readonly)
Returns the value of attribute until_str.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def until_str @until_str end |
#was_truncated ⇒ Object (readonly)
Returns the value of attribute was_truncated.
19 20 21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 19 def was_truncated @was_truncated end |
Instance Method Details
#dropped(i) ⇒ Object
29 30 31 32 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 29 def dropped(i) n = next_step(i) n ? steps[i][:sessions] - n[:sessions] : 0 end |
#format_gap(ms) ⇒ Object
23 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 23 def format_gap(ms) = (ms < 1000) ? "#{ms.round}ms" : format_duration(0, ms) |
#next_step(i) ⇒ Object
27 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 27 def next_step(i) = steps[i + 1] |
#step_one_sessions ⇒ Object
25 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 25 def step_one_sessions = @step_one_sessions ||= steps.first&.fetch(:sessions).to_i |
#template ⇒ Object
21 |
# File 'lib/sentiero/web/views/funnel_view.rb', line 21 def template = "analytics_funnel.html.erb" |