Class: CARPS::DM::Mailer

Inherits:
ModMailer show all
Defined in:
lib/carps/service/dm/mailer.rb

Overview

A bridge between the DM mod and CARPS

Instance Method Summary collapse

Methods inherited from ModMailer

#load, #save

Constructor Details

#initialize(mailer, conf, session, dm, mod, desc) ⇒ Mailer

Create the mailer from

a Mailer,

a GameConfig,

a session id,

the email address of the dm,

the name of the mod,

and the description of the game



41
42
43
44
45
46
47
# File 'lib/carps/service/dm/mailer.rb', line 41

def initialize mailer, conf, session, dm, mod, desc
   super mailer, conf
   @session = session
   @dm = dm
   @mod = mod
   @about = desc
end

Instance Method Details

#check(type) ⇒ Object

Check for mail of a given type



57
58
59
# File 'lib/carps/service/dm/mailer.rb', line 57

def check type
   @mailer.check type
end

#invite(addr) ⇒ Object

Invite a new player



50
51
52
53
# File 'lib/carps/service/dm/mailer.rb', line 50

def invite addr
   inv = Invite.new @dm, @mod, @about, @session
   relay addr, inv
end

#relay(to, message) ⇒ Object

Send mail to the recipient



62
63
64
# File 'lib/carps/service/dm/mailer.rb', line 62

def relay to, message
   @mailer.send to, message
end