Class: Keystone::Mail::MessageFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/keystone/mail__old/message_factory.rb

Class Method Summary collapse

Class Method Details

.create(opt) ⇒ Object



5
6
7
8
9
10
11
12
13
14
15
16
# File 'lib/keystone/mail__old/message_factory.rb', line 5

def self.create(opt)
  message = MessageIso2022jp.new(opt)
  if opt.key?(:encoding)
    case opt[:encoding]
    when :sjis
      message = MessageSjis.new(opt)
    else
      raise "encoding '#{opt[:encoding]}' is not supported"
    end
  end
  return message
end