Class: Courrier::Email::Options
- Inherits:
-
Object
- Object
- Courrier::Email::Options
- Defined in:
- lib/courrier/email/options.rb
Instance Attribute Summary collapse
-
#bcc ⇒ Object
readonly
Returns the value of attribute bcc.
-
#cc ⇒ Object
readonly
Returns the value of attribute cc.
-
#from ⇒ Object
readonly
Returns the value of attribute from.
-
#reply_to ⇒ Object
readonly
Returns the value of attribute reply_to.
-
#subject ⇒ Object
readonly
Returns the value of attribute subject.
-
#to ⇒ Object
readonly
Returns the value of attribute to.
Instance Method Summary collapse
- #html ⇒ Object
-
#initialize(options = {}) ⇒ Options
constructor
A new instance of Options.
- #text ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Options
Returns a new instance of Options.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/courrier/email/options.rb', line 10 def initialize( = {}) @from = .fetch(:from, nil) @to = .fetch(:to, nil) @reply_to = .fetch(:reply_to, nil) @cc = .fetch(:cc, nil) @bcc = .fetch(:bcc, nil) @subject = .fetch(:subject, "") @text = .fetch(:text, "") @html = .fetch(:html, "") @auto_generate_text = .fetch(:auto_generate_text, false) @layouts = Array([:layouts]) raise Courrier::ArgumentError, "Recipient (`to`) is required" unless @to raise Courrier::ArgumentError, "Sender (`from`) is required" unless @from end |
Instance Attribute Details
#bcc ⇒ Object (readonly)
Returns the value of attribute bcc.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def bcc @bcc end |
#cc ⇒ Object (readonly)
Returns the value of attribute cc.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def cc @cc end |
#from ⇒ Object (readonly)
Returns the value of attribute from.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def from @from end |
#reply_to ⇒ Object (readonly)
Returns the value of attribute reply_to.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def reply_to @reply_to end |
#subject ⇒ Object (readonly)
Returns the value of attribute subject.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def subject @subject end |
#to ⇒ Object (readonly)
Returns the value of attribute to.
8 9 10 |
# File 'lib/courrier/email/options.rb', line 8 def to @to end |
Instance Method Details
#html ⇒ Object
32 |
# File 'lib/courrier/email/options.rb', line 32 def html = wrap(@html, with_layout: :html) |
#text ⇒ Object
30 |
# File 'lib/courrier/email/options.rb', line 30 def text = wrap(transformed_text, with_layout: :text) |