Class: Dsu::Views::EntryGroup::Shared::NoEntriesToDisplay
- Inherits:
-
Object
- Object
- Dsu::Views::EntryGroup::Shared::NoEntriesToDisplay
- Includes:
- Support::ColorThemable, Support::TimeFormatable
- Defined in:
- lib/dsu/views/entry_group/shared/no_entries_to_display.rb
Direct Known Subclasses
NoEntriesToDisplayForMonthOf, NoEntriesToDisplayForWeekOf, NoEntriesToDisplayForYearOf
Instance Method Summary collapse
-
#initialize(times:, options: {}) ⇒ NoEntriesToDisplay
constructor
A new instance of NoEntriesToDisplay.
-
#render ⇒ Object
TODO: I18n.
- #render_as_string ⇒ Object
Methods included from Support::TimeFormatable
dd_mm_yyyy, formatted_time, mm_dd, mm_dd_yyyy, timezone_for, yyyy_mm_dd, yyyy_mm_dd_or_through_for
Methods included from Support::ColorThemable
apply_theme, #prompt_with_options
Constructor Details
#initialize(times:, options: {}) ⇒ NoEntriesToDisplay
Returns a new instance of NoEntriesToDisplay.
15 16 17 18 19 20 21 22 |
# File 'lib/dsu/views/entry_group/shared/no_entries_to_display.rb', line 15 def initialize(times:, options: {}) raise ArgumentError, 'times must be an Array' unless times.is_a?(Array) raise ArgumentError, 'times must contain Time objects' unless times.all?(Time) raise ArgumentError, 'options must be a Hash' unless .is_a?(Hash) || .nil? @times = times = || {} end |
Instance Method Details
#render ⇒ Object
TODO: I18n.
25 26 27 |
# File 'lib/dsu/views/entry_group/shared/no_entries_to_display.rb', line 25 def render puts render_as_string end |
#render_as_string ⇒ Object
29 30 31 |
# File 'lib/dsu/views/entry_group/shared/no_entries_to_display.rb', line 29 def render_as_string apply_theme(, theme_color: color_theme.info) end |