Class: Griddler::Email
- Inherits:
-
Object
- Object
- Griddler::Email
- Includes:
- ActionView::Helpers::SanitizeHelper
- Defined in:
- lib/griddler/email.rb
Instance Attribute Summary collapse
-
#attachments ⇒ Object
readonly
Returns the value of attribute attachments.
-
#body ⇒ Object
readonly
Returns the value of attribute body.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#headers ⇒ Object
readonly
Returns the value of attribute headers.
-
#raw_body ⇒ Object
readonly
Returns the value of attribute raw_body.
-
#raw_headers ⇒ Object
readonly
Returns the value of attribute raw_headers.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
-
#initialize(params) ⇒ Email
constructor
A new instance of Email.
- #process ⇒ Object
Constructor Details
#initialize(params) ⇒ Email
Returns a new instance of Email.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/griddler/email.rb', line 9 def initialize(params) @params = params @to = extract_address(params[:to], config.to) @from = extract_address(params[:from], :email) @subject = params[:subject] @body = extract_body @raw_body = params[:text] || params[:html] @headers = extract_headers @raw_headers = params[:headers] @attachments = params[:attachments] end |
Instance Attribute Details
#attachments ⇒ Object (readonly)
Returns the value of attribute attachments.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def @attachments end |
#body ⇒ Object (readonly)
Returns the value of attribute body.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def body @body end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def from @from end |
#headers ⇒ Object (readonly)
Returns the value of attribute headers.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def headers @headers end |
#raw_body ⇒ Object (readonly)
Returns the value of attribute raw_body.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def raw_body @raw_body end |
#raw_headers ⇒ Object (readonly)
Returns the value of attribute raw_headers.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def raw_headers @raw_headers end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def subject @subject end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
6 7 8 |
# File 'lib/griddler/email.rb', line 6 def to @to end |
Instance Method Details
#process ⇒ Object
25 26 27 28 |
# File 'lib/griddler/email.rb', line 25 def process processor_class = config.processor_class processor_class.process(self) end |