Class: Mail::Encodings::Identity

Inherits:
TransferEncoding show all
Defined in:
lib/mail/encodings/identity.rb

Overview

Identity encodings do no encoding/decoding and have a fixed cost: 1 byte in -> 1 byte out.

Direct Known Subclasses

Binary

Constant Summary

Constants inherited from TransferEncoding

TransferEncoding::NAME, TransferEncoding::PRIORITY

Class Method Summary collapse

Methods inherited from TransferEncoding

can_encode?, can_transport?, compatible_input?, lowest_cost, negotiate, renegotiate, to_s

Class Method Details

.cost(str) ⇒ Object

1 output byte per input byte.


19
20
21
# File 'lib/mail/encodings/identity.rb', line 19

def self.cost(str)
  1.0
end

.decode(str) ⇒ Object

:nodoc:


10
11
12
# File 'lib/mail/encodings/identity.rb', line 10

def self.decode(str)
  str
end

.encode(str) ⇒ Object


14
15
16
# File 'lib/mail/encodings/identity.rb', line 14

def self.encode(str)
  str
end