Class: Antwort::Build
- Inherits:
-
Object
- Object
- Antwort::Build
- Includes:
- FileHelpers, Helpers
- Defined in:
- lib/antwort/email/build.rb
Instance Attribute Summary collapse
-
#id ⇒ Object
readonly
Returns the value of attribute id.
Instance Method Summary collapse
- #create! ⇒ Object
-
#initialize(emails, opts = {}) ⇒ Build
constructor
A new instance of Build.
Methods included from FileHelpers
#count_files, #create_file!, #email_id_from_folder_name, #list_folders
Methods included from Helpers
Constructor Details
#initialize(emails, opts = {}) ⇒ Build
Returns a new instance of Build.
10 11 12 13 14 |
# File 'lib/antwort/email/build.rb', line 10 def initialize(emails, opts = {}) @id = @emails = emails.is_a?(Array) ? emails : [].push(emails) @options = opts end |
Instance Attribute Details
#id ⇒ Object (readonly)
Returns the value of attribute id.
8 9 10 |
# File 'lib/antwort/email/build.rb', line 8 def id @id end |
Instance Method Details
#create! ⇒ Object
16 17 18 19 20 21 22 |
# File 'lib/antwort/email/build.rb', line 16 def create! @emails.each do |email_id| attrs = { email: email_id, id: @id }.merge(@options) build_email(attrs) build_partials(attrs) if @options[:partials] end end |