Module TMail::StrategyInterface
In: lib/tmail/encode.rb

Methods

Public Instance methods

[Source]

# File lib/tmail/encode.rb, line 45
    def accept_strategy(klass, eol, charset, dest = nil)
      dest ||= ''
      accept klass.new(create_dest(dest), charset, eol)
      dest
    end

[Source]

# File lib/tmail/encode.rb, line 21
    def create_dest(obj)
      case obj
      when nil
        StringOutput.new
      when String
        StringOutput.new(obj)
      when IO, StringOutput
        obj
      else
        raise TypeError, 'cannot handle this type of object for dest'
      end
    end

[Source]

# File lib/tmail/encode.rb, line 39
    def decoded(eol = "\n", charset = 'e', dest = nil)
      accept_strategy Decoder, eol, charset, dest
    end

[Source]

# File lib/tmail/encode.rb, line 35
    def encoded(eol = "\r\n", charset = 'j', dest = nil)
      accept_strategy Encoder, eol, charset, dest
    end
to_s(eol = "\n", charset = 'e', dest = nil)

Alias for decoded

[Validate]