Permalink
Browse files

allow specifying options in SignedMail.new

  • Loading branch information...
1 parent 0238d59 commit 06c89376d2d11abddd4ad9b3721ba881c68892ad @jhawthorn jhawthorn committed May 10, 2011
Showing with 7 additions and 7 deletions.
  1. +7 −7 lib/dkim/signed_mail.rb
View
14 lib/dkim/signed_mail.rb
@@ -5,18 +5,18 @@ module Dkim
class SignedMail
EMAIL_REGEX = /[A-Z0-9._%+-]+@([A-Z0-9.-]+\.[A-Z]{2,6})/i
- def initialize message
+ def initialize message, options={}
message = message.gsub(/\r?\n/, "\r\n")
headers, body = message.split(/\r?\n\r?\n/, 2)
@headers = HeaderList.new headers
@body = Body.new body
- @signable_headers = nil
- @domain = nil
- @selector = nil
- @time = nil
- @signing_algorithm = nil
- @private_key = nil
+ @signable_headers = options[:signable_headers]
+ @domain = options[:domain]
+ @selector = options[:selector]
+ @time = options[:time]
+ @signing_algorithm = options[:signing_algorithm]
+ @private_key = options[:private_key]
end
# options for signatures

0 comments on commit 06c8937

Please sign in to comment.