class Lita::Updates::Commands::Data

Attributes

redis[R]
response[R]

Public Class Methods

new(redis, response) click to toggle source
# File lib/lita/updates/commands/data.rb, line 2
def initialize(redis, response)
  @redis    = redis
  @response = response
end

Public Instance Methods

export() click to toggle source
# File lib/lita/updates/commands/data.rb, line 7
def export
  response.reply "JSON: \`#{redis.get("lita-updates:schedule")}\`"
end
import() click to toggle source
# File lib/lita/updates/commands/data.rb, line 11
def import
  json = response.message.body.gsub(/^standup import\s+/, "")
  redis.set "lita-updates:schedule", json

  response.reply "The schedule data has been updated."
end