conglomerate 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f9f3f14b27e132968770842dd2d3fe7796a25fbc
4
- data.tar.gz: 2174933a1f8470094242bbb92f77f967aaaa0dfc
3
+ metadata.gz: 35e29cbdebf5437c615db1edc75d9b24accf5494
4
+ data.tar.gz: d9061aea37cc1b044ff55a23767d418311b8ba1d
5
5
  SHA512:
6
- metadata.gz: 080da2cec601bb44e310a6afad4dad3560bd47aa56f2de7feb0f9aef7ced1049fe5547d15028965583fe47e66486c42f9ad909458e7743ca0449635bfd211770
7
- data.tar.gz: f5b2ea4b96a812f0f54d5b12a0f5bf5212d8af9d8441d4d8397bfe6586a63f8bfd7594eb21a0ed8236fb1fcaff88fe62b83813ce29b6a2e16b0fa9099e430218
6
+ metadata.gz: 0a90ff5aec3808eb7fa85e6177c9b0342d6ccd6b492cd23650b38026dc0d3a3c03996127781d54bdfc5b9c321d34dcd616c339689bfecfc78b9e7a5b45fed3d9
7
+ data.tar.gz: 904ba11b106db17f93037080ec86627f6e0376a92f57c0c78e6cc4992236a40c57f1f7ba133be0c7efddf59c7ad92062d39f61b4f2344cd5c4ea10d4263084ab
@@ -3,5 +3,21 @@ module Conglomerate
3
3
  include Conglomerate::Particle
4
4
 
5
5
  array :data, :contains => Datum
6
+
7
+ def build(attrs = {})
8
+ attrs = Hash[attrs.map{ |k, v| [k.to_sym, v] }]
9
+ template = Template.new
10
+
11
+ data.each do |datum|
12
+ if attrs.has_key?(datum.name.to_sym)
13
+ template.data << Datum.new(
14
+ :name => datum.name,
15
+ :value => attrs[datum.name.to_sym]
16
+ )
17
+ end
18
+ end
19
+
20
+ { "template" => Conglomerate.serialize(template) }
21
+ end
6
22
  end
7
23
  end
@@ -1,3 +1,3 @@
1
1
  module Conglomerate
2
- VERSION = "0.8.0"
2
+ VERSION = "0.8.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: conglomerate
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shane Emmons
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2014-05-13 00:00:00.000000000 Z
12
+ date: 2014-05-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler