Class: Sentiero::Web::Views::MaintenanceView

Inherits:
BaseView
  • Object
show all
Defined in:
lib/sentiero/web/views/maintenance_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(retention_period:, purged: nil, error: nil) ⇒ MaintenanceView

Returns a new instance of MaintenanceView.



9
10
11
12
13
14
# File 'lib/sentiero/web/views/maintenance_view.rb', line 9

def initialize(retention_period:, purged: nil, error: nil)
  super()
  @retention_period = retention_period
  @purged = purged
  @error = error
end

Instance Attribute Details

#errorObject (readonly)

Returns the value of attribute error.



16
17
18
# File 'lib/sentiero/web/views/maintenance_view.rb', line 16

def error
  @error
end

#purgedObject (readonly)

Returns the value of attribute purged.



16
17
18
# File 'lib/sentiero/web/views/maintenance_view.rb', line 16

def purged
  @purged
end

#retention_periodObject (readonly)

Returns the value of attribute retention_period.



16
17
18
# File 'lib/sentiero/web/views/maintenance_view.rb', line 16

def retention_period
  @retention_period
end

Instance Method Details

#retention_daysObject



18
19
20
21
# File 'lib/sentiero/web/views/maintenance_view.rb', line 18

def retention_days
  days = (retention_period / 86_400.0).round(1)
  (days % 1 == 0) ? days.to_i : days
end

#templateObject



23
# File 'lib/sentiero/web/views/maintenance_view.rb', line 23

def template = "maintenance.html.erb"