Sha256: acdfb1b172f3693ddcc7366f66896588877cc3400ee4b9d95e9c81c33b853f6c
Contents?: true
Size: 597 Bytes
Versions: 11
Compression:
Stored size: 597 Bytes
Contents
module Ruboty::Actions::Ragoon class Event < ::Ruboty::Actions::Base include ::Ruboty::Actions::Ragoon def call target_date = parse_date(message[:date]) events = ::Ruboty::Ragoon::Event.new(target_date) message.reply(events.render(private: private?)) end private def parse_date(date) date = date.strip.downcase case date when 'today' Date.today when 'tomorrow' Date.today + 1 when 'yesterday' Date.today - 1 else Date.parse(date) end rescue Date.today end end end
Version data entries
11 entries across 11 versions & 1 rubygems