class MandrillQueue::Message::Attachments

Public Class Methods

new() click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 119
def initialize
        @_attachments = []
end

Public Instance Methods

add(*args, &block) click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 123
def add(*args, &block)
        @_attachments << attachment_class.new(*args, &block)
end
attachment_class() click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 127
def attachment_class
        @_klass ||= Attachment
end
attachments() click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 153
def attachments
        @_attachments
end
count() click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 131
def count
        @_attachments.count
end
load_all() click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 135
def load_all
        @_attachments.each(&:load_file)
end
set!(list) click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 145
def set!(list)
        @_attachments = list.map do |obj|
                attachment_class.new.set!(obj.symbolize_keys)
        end

        self
end
to_a(options = {}) click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 139
def to_a(options = {})
        @_attachments.map do |a|
                a.to_hash(options)
        end
end
validate(errors, options = {}) click to toggle source
# File lib/mandrill_queue/message/attachments.rb, line 157
def validate(errors, options = {})
        @_attachments.each do |a|
                a.validate(errors, options)
        end
end