Class: Dsu::Views::EntryGroup::Shared::NoEntriesToDisplay

Inherits:
Object
  • Object
show all
Includes:
Support::ColorThemable, Support::TimeFormatable
Defined in:
lib/dsu/views/entry_group/shared/no_entries_to_display.rb

Instance Method Summary collapse

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.

Raises:

  • (ArgumentError)


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 options.is_a?(Hash) || options.nil?

  @times = times
  @options = options || {}
end

Instance Method Details

#renderObject

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_stringObject



29
30
31
# File 'lib/dsu/views/entry_group/shared/no_entries_to_display.rb', line 29

def render_as_string
  apply_theme(message, theme_color: color_theme.info)
end