Sha256: 9d49944b34c9a20e547e6ffcd5302fb6b8319c284a1bac78e91b5843dc118d00
Contents?: true
Size: 444 Bytes
Versions: 11
Compression:
Stored size: 444 Bytes
Contents
class Mailboxer::BaseBuilder attr_reader :params def initialize(params) @params = params.with_indifferent_access end def build klass.new.tap do |object| params.keys.each do |field| object.send("#{field}=", get(field)) unless get(field).nil? end end end protected def get(key) respond_to?(key) ? send(key) : params[key] end def recipients Array(params[:recipients]).uniq end end
Version data entries
11 entries across 11 versions & 1 rubygems