Class: SnapshotInspector::Snapshot::MailType

Inherits:
Type
  • Object
show all
Defined in:
app/models/snapshot_inspector/snapshot/mail_type.rb

Instance Method Summary collapse

Methods inherited from Type

#as_json, extract, from_hash, snapshotee, #type

Instance Method Details

#action_nameObject



30
31
32
# File 'app/models/snapshot_inspector/snapshot/mail_type.rb', line 30

def action_name
  message.header["X-SnapshotInspector-Action-Name"].value
end

#extract(snapshotee) ⇒ Object



9
10
11
12
# File 'app/models/snapshot_inspector/snapshot/mail_type.rb', line 9

def extract(snapshotee)
  @message = snapshotee.to_s
  @bcc = snapshotee.bcc
end

#from_hash(hash) ⇒ Object



15
16
17
18
# File 'app/models/snapshot_inspector/snapshot/mail_type.rb', line 15

def from_hash(hash)
  @message = hash[:message]
  @bcc = hash[:bcc]
end

#mailer_nameObject



26
27
28
# File 'app/models/snapshot_inspector/snapshot/mail_type.rb', line 26

def mailer_name
  message.header["X-SnapshotInspector-Mailer-Name"].value
end

#messageObject



20
21
22
23
24
# File 'app/models/snapshot_inspector/snapshot/mail_type.rb', line 20

def message
  message = Mail::Message.new(@message)
  message.bcc = @bcc
  message
end