Class: Sentiero::Web::Views::MaintenanceView
- 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
-
#error ⇒ Object
readonly
Returns the value of attribute error.
-
#purged ⇒ Object
readonly
Returns the value of attribute purged.
-
#retention_period ⇒ Object
readonly
Returns the value of attribute retention_period.
Attributes inherited from BaseView
Instance Method Summary collapse
-
#initialize(retention_period:, purged: nil, error: nil) ⇒ MaintenanceView
constructor
A new instance of MaintenanceView.
- #retention_days ⇒ 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(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
#error ⇒ Object (readonly)
Returns the value of attribute error.
16 17 18 |
# File 'lib/sentiero/web/views/maintenance_view.rb', line 16 def error @error end |
#purged ⇒ Object (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_period ⇒ Object (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_days ⇒ Object
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 |
#template ⇒ Object
23 |
# File 'lib/sentiero/web/views/maintenance_view.rb', line 23 def template = "maintenance.html.erb" |