Class: Inquirex::DSL::SendEmailBuilder
- Inherits:
-
Object
- Object
- Inquirex::DSL::SendEmailBuilder
- Defined in:
- lib/inquirex/dsl/send_email_builder.rb
Overview
Collects the fields of a send_email block. Every setter is an explicit
builder method — the block form mirrors the step builders (type,
question, ...) rather than a keyword-argument hash:
send_email if: not_empty(:email) do
to "{{email}}"
from "forms@agentica.group"
subject "Thanks {{name}}"
markdown_text <<~TEXT
Hi {{name}}, we got your answers:
{{answers_summary}}
TEXT
end
Instance Attribute Summary collapse
-
#params ⇒ Hash{Symbol => Object}
readonly
Collected SendEmail constructor params.
Instance Method Summary collapse
- #bcc(value) ⇒ void
- #cc(value) ⇒ void
- #from(value) ⇒ void
- #headers(value) ⇒ void
- #html(value) ⇒ void
-
#initialize ⇒ SendEmailBuilder
constructor
A new instance of SendEmailBuilder.
- #markdown_text(value) ⇒ void
- #reply_to(value) ⇒ void
- #subject(value) ⇒ void
- #text(value) ⇒ void
- #to(value) ⇒ void
Constructor Details
#initialize ⇒ SendEmailBuilder
Returns a new instance of SendEmailBuilder.
23 24 25 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 23 def initialize @params = {} end |
Instance Attribute Details
#params ⇒ Hash{Symbol => Object} (readonly)
Returns collected SendEmail constructor params.
21 22 23 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 21 def params @params end |
Instance Method Details
#bcc(value) ⇒ void
This method returns an undefined value.
47 48 49 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 47 def bcc(value) @params[:bcc] = value end |
#cc(value) ⇒ void
This method returns an undefined value.
41 42 43 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 41 def cc(value) @params[:cc] = value end |
#from(value) ⇒ void
This method returns an undefined value.
35 36 37 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 35 def from(value) @params[:from] = value end |
#headers(value) ⇒ void
This method returns an undefined value.
65 66 67 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 65 def headers(value) @params[:headers] = value end |
#html(value) ⇒ void
This method returns an undefined value.
83 84 85 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 83 def html(value) @params[:html] = value end |
#markdown_text(value) ⇒ void
This method returns an undefined value.
77 78 79 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 77 def markdown_text(value) @params[:markdown_text] = value end |
#reply_to(value) ⇒ void
This method returns an undefined value.
53 54 55 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 53 def reply_to(value) @params[:reply_to] = value end |
#subject(value) ⇒ void
This method returns an undefined value.
59 60 61 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 59 def subject(value) @params[:subject] = value end |
#text(value) ⇒ void
This method returns an undefined value.
71 72 73 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 71 def text(value) @params[:text] = value end |
#to(value) ⇒ void
This method returns an undefined value.
29 30 31 |
# File 'lib/inquirex/dsl/send_email_builder.rb', line 29 def to(value) @params[:to] = value end |