Sha256: a4ddca79869f49e71013c48ab12ddf370e12f9bf48ec4e5594596fda1f7c0a9d
Contents?: true
Size: 521 Bytes
Versions: 11
Compression:
Stored size: 521 Bytes
Contents
module Conglomerate class Template include Conglomerate::Particle array :data, :contains => Datum def build(attrs = {}) attrs = Hash[attrs.map{ |k, v| [k.to_sym, v] }] template = Template.new data.each do |datum| if attrs.has_key?(datum.name.to_sym) template.data << Datum.new( :name => datum.name, :value => attrs[datum.name.to_sym] ) end end { "template" => Conglomerate.serialize(template) } end end end
Version data entries
11 entries across 11 versions & 1 rubygems