emp_json 1.4.0.pre.g116cfb0af → 1.5.0.pre.g2ee19a819

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
  SHA256:
3
- metadata.gz: db8ae7e00135fe90e122cafa2334da420e5f880ad18b9bc38ef5185974896c71
4
- data.tar.gz: 6570ec075a62745233853b38e5d9d6d15a4732356b8c22afb9c087818912a94e
3
+ metadata.gz: 03b92594da331b167748813e6d73536058d95bea581362991d5782a369b6260c
4
+ data.tar.gz: 495f9304fcb1257cab930d51dc3b6320440e8f7d2f118f30fd547d751357dbed
5
5
  SHA512:
6
- metadata.gz: 850ba38394542800c7f40f08f9be4403ccf1a8b5a91ade1d56852f16fb89238c544b3569db778a7139aee37cc4ea6aa6889172f18cc1bfb1e46214b3eebbff7a
7
- data.tar.gz: e2fbc4da1d07b53a03da240a325423eeed185099a24b9c1f069a4f181975f658c88b80e1def378d9284aedd469f77a01c9b59fd9e795885f9921f74b2576a772
6
+ metadata.gz: d484a1032b846f3726224d67788796ca32d5b3a0eb5fa97e1b1c1a39bd5d2c88d4ec945ec1101548507e591b5d7dc7ee98876cf1fe0a1fbaca517beb6d47bcee
7
+ data.tar.gz: cabea5bbb42b16d37dca7dc6cf176495389db2345949dd27b9234b9af07eee1bbd180704a48780d216e49e9339a742035f6f3dc77c76e1718c70ab124199018c
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emp_json (1.4.0.pre.g116cfb0af)
4
+ emp_json (1.5.0.pre.g2ee19a819)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -29,8 +29,9 @@ module Empathy
29
29
  RDF_XSD_DATETIME = "#{RDF_XSD}dateTime"
30
30
  RDF_XSD_BOOLEAN = "#{RDF_XSD}boolean"
31
31
  RDF_XSD_INTEGER = "#{RDF_XSD}integer"
32
- RDF_XSD_DECIMAL = "#{RDF_XSD}decimal"
32
+ RDF_XSD_FLOAT = "#{RDF_XSD}float"
33
33
  RDF_XSD_DOUBLE = "#{RDF_XSD}double"
34
+ RDF_XSD_DECIMAL = "#{RDF_XSD}decimal"
34
35
 
35
36
  def object_to_value(value)
36
37
  return primitive_to_value(value.iri) if value.respond_to?(:iri)
@@ -102,7 +103,7 @@ module Empathy
102
103
  shorthand(EMP_TYPE_BOOL, value.value)
103
104
  when RDF_XSD_DOUBLE
104
105
  shorthand(EMP_TYPE_DOUBLE, value.value)
105
- when RDF_XSD_DECIMAL
106
+ when RDF_XSD_DECIMAL, RDF_XSD_FLOAT
106
107
  primitive(value.datatype.to_s, value.value)
107
108
  when RDF_XSD_INTEGER
108
109
  integer_to_value(value.to_i)
@@ -58,7 +58,7 @@ module Empathy
58
58
  end
59
59
 
60
60
  def value_for_attribute(attr, resource, serialization_params)
61
- return resource.try(attr.method) if attr.method.is_a?(Symbol)
61
+ return resource.try(attr.method) if attr.method.is_a?(Symbol) || attr.method.is_a?(String)
62
62
 
63
63
  FastJsonapi.call_proc(attr.method, resource, serialization_params)
64
64
  end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Empathy
4
4
  module EmpJson
5
- VERSION = "1.4.0"
5
+ VERSION = "1.5.0"
6
6
  end
7
7
  end
@@ -44,10 +44,12 @@ module Empathy
44
44
 
45
45
  RDF_XSD_INTEGER: "http://www.w3.org/2001/XMLSchema#integer"
46
46
 
47
- RDF_XSD_DECIMAL: "http://www.w3.org/2001/XMLSchema#decimal"
47
+ RDF_XSD_FLOAT: "http://www.w3.org/2001/XMLSchema#float"
48
48
 
49
49
  RDF_XSD_DOUBLE: "http://www.w3.org/2001/XMLSchema#double"
50
50
 
51
+ RDF_XSD_DECIMAL: "http://www.w3.org/2001/XMLSchema#decimal"
52
+
51
53
  type shorthand = { type: string, v: string }
52
54
  type primitive = { type: string, dt: string, v: string }
53
55
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: emp_json
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0.pre.g116cfb0af
4
+ version: 1.5.0.pre.g2ee19a819
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom van Kalkeren
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-08-16 00:00:00.000000000 Z
11
+ date: 2022-08-17 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Serializer for the EmpJson specification.
14
14
  email: