Class: Dkim::Body
- Inherits:
-
Struct
- Object
- Struct
- Dkim::Body
- Includes:
- Canonicalizable
- Defined in:
- lib/dkim/body.rb
Instance Attribute Summary collapse
-
#body ⇒ Object
Returns the value of attribute body.
Instance Method Summary collapse
Methods included from Canonicalizable
Instance Attribute Details
#body ⇒ Object
Returns the value of attribute body
4 5 6 |
# File 'lib/dkim/body.rb', line 4 def body @body end |
Instance Method Details
#canonical_relaxed ⇒ Object
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/dkim/body.rb', line 7 def canonical_relaxed # special case from errata 1377 return "" if self.body.empty? body = self.body.dup # Reduces all sequences of WSP within a line to a single SP character. body.gsub!(/[ \t]+/, ' ') # Ignores all whitespace at the end of lines. Implementations MUST NOT remove the CRLF at the end of the line. body.gsub!(/ \r\n/, "\r\n") # Ignores all empty lines at the end of the message body. body.gsub!(/[ \r\n]*\z/, '') body += "\r\n" end |
#canonical_simple ⇒ Object
24 25 26 27 28 29 30 |
# File 'lib/dkim/body.rb', line 24 def canonical_simple body = self.body.dup # Ignores all empty lines at the end of the message body. body.gsub!(/(\r?\n)*\z/, '') body += "\r\n" end |