Module: RailsCom::ActionMailbox::MailExt

Defined in:
lib/rails_com/action_mailbox/mail_ext.rb

Instance Method Summary collapse

Instance Method Details

#fromObject



4
5
6
7
8
9
10
11
12
13
# File 'lib/rails_com/action_mailbox/mail_ext.rb', line 4

def from
  r = super
  if r.is_a?(String)
    r.encode('utf-8', replace: '')
  elsif r.is_a?(Array)
    r.map { |i| i.encode('utf-8', replace: '') }
  else
    super
  end
end

#subjectObject



26
27
28
# File 'lib/rails_com/action_mailbox/mail_ext.rb', line 26

def subject
  super.encode('utf-8', replace: '')
end

#toObject



15
16
17
18
19
20
21
22
23
24
# File 'lib/rails_com/action_mailbox/mail_ext.rb', line 15

def to
  r = super
  if r.is_a?(String)
    r.encode('utf-8', replace: '')
  elsif r.is_a?(Array)
    r.map { |i| i.encode('utf-8', replace: '') }
  else
    super
  end
end