grom 0.3.7 → 0.3.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/lib/grom/node.rb +12 -3
  3. data/lib/grom/version.rb +1 -1
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d7a585bd4a657c6d3747c88833fd4859bfdf3007
4
- data.tar.gz: d72ca4ca778b4c19720be1f0cfe1bb35054e3f54
3
+ metadata.gz: e42098bf2ed1aef6acd1e537b186f64fe1d10acb
4
+ data.tar.gz: 77665761dba4a869c2e3dd2277c35add4ae1f34d
5
5
  SHA512:
6
- metadata.gz: d5e8debd4e7da0f2377a2ea163cfff5700b61e46f162cd11ef1c31474dbfdd982c3a2ce6df51db00fb39a7103fe90327893f948ac233e65f3be613b80ad84f69
7
- data.tar.gz: 1f2ff02000b8b281fb0ca7ce2d61fa06cb97da2c2cf4a4657b4b88dbe02f078ae813a5affac5a0377bf459baa20575519f740b89b2b40ae65867648b8bcce4e9
6
+ metadata.gz: 63e0fce560ecae5cf8aff919ace24f765ab0d3713742c1d412eaf10e441fc1dc05a0562d9b3d42616ee5a0e5d00c90b9066d27941e57369d93147de88b323ef3
7
+ data.tar.gz: d66051ca6c9181703153ead23ea5dd5002678f81d0072b41669a8234993067b7be3b74171dbb2cdeb3a7ce5abcbfd0ebc447ff721f4a767c42bfb002b05d7543
data/lib/grom/node.rb CHANGED
@@ -81,9 +81,18 @@ module Grom
81
81
  def populate
82
82
  set_graph_id
83
83
  @statements.each do |statement|
84
- attribute_name = Grom::Helper.get_id(statement.predicate)
85
- attribute_value = statement.object.to_s
86
- instance_variable_set("@#{attribute_name}".to_sym, attribute_value)
84
+ predicate = Grom::Helper.get_id(statement.predicate).to_sym
85
+ object = statement.object.to_s
86
+
87
+ instance_variable = instance_variable_get("@#{predicate}")
88
+
89
+ if instance_variable
90
+ instance_variable = instance_variable.is_a?(Array) ? instance_variable.flatten : [instance_variable]
91
+ instance_variable << object
92
+ instance_variable_set("@#{predicate}", instance_variable)
93
+ else
94
+ instance_variable_set("@#{predicate}", object)
95
+ end
87
96
  end
88
97
  end
89
98
  end
data/lib/grom/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Grom
2
- VERSION = '0.3.7'.freeze
2
+ VERSION = '0.3.8'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: grom
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.7
4
+ version: 0.3.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rebecca Appleyard
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: exe
12
12
  cert_chain: []
13
- date: 2017-06-09 00:00:00.000000000 Z
13
+ date: 2017-06-14 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rdf