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 +4 -4
- data/lib/conglomerate/template.rb +16 -0
- data/lib/conglomerate/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35e29cbdebf5437c615db1edc75d9b24accf5494
|
4
|
+
data.tar.gz: d9061aea37cc1b044ff55a23767d418311b8ba1d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
data/lib/conglomerate/version.rb
CHANGED
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.
|
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-
|
12
|
+
date: 2014-05-19 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: bundler
|