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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: baf9653c33444a315a892a3720aa0be0503540db
4
- data.tar.gz: ca4fbe6d2ad6b87d3fabd8f1b68167fd0470475b
3
+ metadata.gz: 35f15bf416da298540d39bee8d5db00fbaf5ff10
4
+ data.tar.gz: a9d3d79948b0b50fa6209e9f7ab893012dd10b21
5
5
  SHA512:
6
- metadata.gz: 06fda50c2eaec5b6bb346e31f40d78d24645211c3d87eef0c6206492d47f481cbde8a0a540ae447a0fdc75a6e31be45e9686bdfd252121f7bb998aa89c7db9ac
7
- data.tar.gz: 94a3b7701bd3291a3cff825782ff06945d1382336574de174030991f2c3f20558537c2ce6423fc8d8fd90c460094f3579c6f2d889abdf2af90c2215691ac8a2a
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(data, subject, value)
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.class._attributes_data.map do |key, data|
47
- next if data.excluded?(serializer)
48
- next unless fields.nil? || fields.include?(key)
49
- add_attribute(data, serializer.read_attribute_for_serialization(:rdf_subject), serializer.attributes[key])
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RDFSerializers
4
4
  module Version
5
- VERSION = '0.0.4'
5
+ VERSION = '0.0.5'
6
6
  end
7
7
  end
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
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: '2.2'
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: '2.2'
60
+ version: '3.0'
61
61
  description:
62
62
  email: arthur@argu.co
63
63
  executables: []