Class: Sentiero::Web::Views::ProblemShowView
- Defined in:
- lib/sentiero/web/views/problem_show_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
-
#facets ⇒ Object
readonly
Returns the value of attribute facets.
-
#occurrences ⇒ Object
readonly
Returns the value of attribute occurrences.
-
#problem ⇒ Object
readonly
Returns the value of attribute problem.
-
#session_ids ⇒ Object
readonly
Returns the value of attribute session_ids.
-
#session_summaries ⇒ Object
readonly
Returns the value of attribute session_summaries.
-
#trend ⇒ Object
readonly
Returns the value of attribute trend.
Attributes inherited from BaseView
Instance Method Summary collapse
- #facet_groups ⇒ Object
- #has_facets? ⇒ Boolean
-
#initialize(problem:, occurrences:, session_ids:, session_summaries:, facets:, trend:) ⇒ ProblemShowView
constructor
A new instance of ProblemShowView.
- #replay_href(s) ⇒ Object
- #spark_max ⇒ 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(problem:, occurrences:, session_ids:, session_summaries:, facets:, trend:) ⇒ ProblemShowView
Returns a new instance of ProblemShowView.
9 10 11 12 13 14 15 16 17 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 9 def initialize(problem:, occurrences:, session_ids:, session_summaries:, facets:, trend:) super() @problem = problem @occurrences = occurrences @session_ids = session_ids @session_summaries = session_summaries @facets = facets @trend = trend end |
Instance Attribute Details
#facets ⇒ Object (readonly)
Returns the value of attribute facets.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def facets @facets end |
#occurrences ⇒ Object (readonly)
Returns the value of attribute occurrences.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def occurrences @occurrences end |
#problem ⇒ Object (readonly)
Returns the value of attribute problem.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def problem @problem end |
#session_ids ⇒ Object (readonly)
Returns the value of attribute session_ids.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def session_ids @session_ids end |
#session_summaries ⇒ Object (readonly)
Returns the value of attribute session_summaries.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def session_summaries @session_summaries end |
#trend ⇒ Object (readonly)
Returns the value of attribute trend.
19 20 21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 19 def trend @trend end |
Instance Method Details
#facet_groups ⇒ Object
34 35 36 37 38 39 40 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 34 def facet_groups [ ["Top Request Paths", facets[:paths]], ["Environments", facets[:environments]], ["Browsers", facets[:browsers]] ] end |
#has_facets? ⇒ Boolean
42 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 42 def has_facets? = facets[:releases].any? || facet_groups.any? { |_title, rows| rows.any? } |
#replay_href(s) ⇒ Object
23 24 25 26 27 28 29 30 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 23 def replay_href(s) sid = s[:session_id] if s[:window_id] "#{h(base_path)}/sessions/#{h(sid)}/windows/#{h(s[:window_id])}" else "#{h(base_path)}/sessions/#{h(sid)}" end end |
#spark_max ⇒ Object
32 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 32 def spark_max = trend[:series].map { |day| day[:count] }.max || 0 |
#template ⇒ Object
21 |
# File 'lib/sentiero/web/views/problem_show_view.rb', line 21 def template = "problem_show.html.erb" |