class MandrillQueue::ArrayMetadata

Public Class Methods

new() click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 51
def initialize
        @_merge_vars = []
end

Public Instance Methods

[](index) click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 75
def [](index)
        @_merge_vars[index]
end
add(*args, &block) click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 55
def add(*args, &block)
        @_merge_vars << Var.new(*args, &block)
end
Also aliased as: dsl
count() click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 79
def count
        @_merge_vars.count
end
dsl(*args, &block)
Alias for: add
first() click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 67
def first
        @_merge_vars.first
end
last() click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 71
def last
        @_merge_vars.last
end
merge_vars() click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 83
def merge_vars
        @_merge_vars
end
set!(list) click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 93
def set!(list)
        @_merge_vars = list.map do |obj|
                Var.new.set!(obj.symbolize_keys)
        end

        self
end
to_a(options = {}) click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 61
def to_a(options = {})
        @_merge_vars.map do |v|
                v.to_hash(options)
        end
end
validate(errors) click to toggle source
# File lib/mandrill_queue/array_metadata.rb, line 87
def validate(errors)
        @_merge_vars.each do |v|
                v.validate(errors)
        end
end