class BubBot::Slack::Command::List

Public Class Methods

aliases() click to toggle source
# File lib/bub_bot/slack/commands/list.rb, line 7
def self.aliases
  %w(list status all wazup)
end

Public Instance Methods

run() click to toggle source
# File lib/bub_bot/slack/commands/list.rb, line 11
def run
  list_strings = servers.list.map do |server, claim|
    if claim['expires_at']
      time_ago = time_ago_in_words(claim['expires_at'])
      "#{server}: *#{claim['user']}'s* for the next #{time_ago}"
    else
      "#{server}: *free*"
    end
  end

  respond(list_strings.join("\n"))
end