rdf-serializers 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/active_model_serializers/adapter/rdf.rb +7 -6
- data/lib/rdf/serializers/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 35f15bf416da298540d39bee8d5db00fbaf5ff10
|
4
|
+
data.tar.gz: a9d3d79948b0b50fa6209e9f7ab893012dd10b21
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 92b62c5b1c3ab8afef09058f761c92ceaf1ca4dd0cb9e217acec641eee1c9bdcffdbb0116fa240b43daddcd165cb59afddb69e706fa85a1aa4785c4a59facdc1
|
7
|
+
data.tar.gz: 983c6a0d3eb67d4832014a1e0ca61e196b774000385b0acfeed33abfc99fc7df34e1d3b79892f8e0439ba5422c4c7e1c8b39b234ca006faae1abd55861b49d16
|
@@ -22,8 +22,7 @@ module ActiveModelSerializers
|
|
22
22
|
|
23
23
|
private
|
24
24
|
|
25
|
-
def add_attribute(
|
26
|
-
predicate = data.options[:predicate]
|
25
|
+
def add_attribute(subject, predicate, value)
|
27
26
|
return unless predicate
|
28
27
|
value = value.respond_to?(:each) ? value : [value]
|
29
28
|
value.compact.map { |v| add_triple(subject, predicate, v) }
|
@@ -43,10 +42,12 @@ module ActiveModelSerializers
|
|
43
42
|
end
|
44
43
|
|
45
44
|
def attributes_for(serializer, fields)
|
46
|
-
serializer.
|
47
|
-
|
48
|
-
|
49
|
-
|
45
|
+
serializer.attributes(fields).each do |key, value|
|
46
|
+
add_attribute(
|
47
|
+
serializer.read_attribute_for_serialization(:rdf_subject),
|
48
|
+
serializer.class._attributes_data[key].try(:options).try(:[], :predicate),
|
49
|
+
value
|
50
|
+
)
|
50
51
|
end
|
51
52
|
end
|
52
53
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rdf-serializers
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arthur Dingemans
|
@@ -50,14 +50,14 @@ dependencies:
|
|
50
50
|
requirements:
|
51
51
|
- - "~>"
|
52
52
|
- !ruby/object:Gem::Version
|
53
|
-
version: '
|
53
|
+
version: '3.0'
|
54
54
|
type: :runtime
|
55
55
|
prerelease: false
|
56
56
|
version_requirements: !ruby/object:Gem::Requirement
|
57
57
|
requirements:
|
58
58
|
- - "~>"
|
59
59
|
- !ruby/object:Gem::Version
|
60
|
-
version: '
|
60
|
+
version: '3.0'
|
61
61
|
description:
|
62
62
|
email: arthur@argu.co
|
63
63
|
executables: []
|