Class: Mail::Gpg::VersionPart

Inherits:
Part
  • Object
show all
Defined in:
lib/mail/gpg/version_part.rb

Constant Summary collapse

VERSION_1 =
'Version: 1'
CONTENT_TYPE =
'application/pgp-encrypted'
CONTENT_DESC =
'PGP/MIME Versions Identification'

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(*args) ⇒ VersionPart

Returns a new instance of VersionPart.



10
11
12
13
14
15
# File 'lib/mail/gpg/version_part.rb', line 10

def initialize(*args)
  super
  body VERSION_1
  content_type CONTENT_TYPE
  content_description CONTENT_DESC
end

Class Method Details

.isVersionPart?(part) ⇒ Boolean

Returns:

  • (Boolean)


17
18
19
# File 'lib/mail/gpg/version_part.rb', line 17

def self.isVersionPart?(part)
  part.mime_type == CONTENT_TYPE && part.body =~ /#{VERSION_1}/
end