class Ruboty::DMM::Actions::Messenger

Public Instance Methods

call() click to toggle source
# File lib/ruboty/dmm/actions/messenger.rb, line 5
def call
  attachments = Ruboty::DMM::Ranking.new(message.match_data).arts
  term = term_converter(message.match_data[:term])
  message.reply("#{term}のランキングです。", attachments: attachments) # temporary ignoring tags. I have to add interface for tags
rescue => exception
  message.reply("Failed by #{exception.class}")
end

Private Instance Methods

term_converter(term) click to toggle source
# File lib/ruboty/dmm/actions/messenger.rb, line 15
def term_converter(term)
  case term
  when '24'
    '24時間'
  when 'weekly'
    '週間'
  when 'monthly'
    '月間'
  when 'total'
    '全体'
  else
    raise TypeError
  end
end