Class: Achoo::Plugin::Ical

Inherits:
Achoo::PluginBase show all
Includes:
UI::ExceptionHandling
Defined in:
lib/achoo/plugin/ical.rb

Instance Method Summary collapse

Methods included from UI::ExceptionHandling

#get_exception_reason, #handle_exception, #handle_fatal_exception

Instance Method Details

#at_startupObject



14
15
16
# File 'lib/achoo/plugin/ical.rb', line 14

def at_startup
  warm_up_ical_cache
end

#before_register_hour_remark(date) ⇒ Object



18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/achoo/plugin/ical.rb', line 18

def before_register_hour_remark(date)
  puts '-' * 80
  puts "Calendar events for #{date}:"
  puts '---'
  begin
    RC[:ical].each do |config|
      Achoo::ICal.from_http_request(config).print_events(date)
    end
  rescue Exception => e
    puts handle_exception("Failed to retrieve calendar events.", e)
  end
end

#state_ok?Boolean

Returns:

  • (Boolean)


12
# File 'lib/achoo/plugin/ical.rb', line 12

def state_ok?; RC.has_key?(:ical) && !RC[:ical].empty?; end