emp_json 1.4.0.pre.g4cafffeae → 1.4.0.pre.g8ecc8d148

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: d2cfd4b534090019df728bd1403998dec3dfb37c6028c3f423f4688cfaa4cd8f
4
- data.tar.gz: 6d312acaac6c1c97bbaba8e9a2c7a5873af24765f7d473866a5745c3c1e98691
3
+ metadata.gz: e18b3c7c69ff1b1733e2f24f1bc062d486f602d99c87dcef901a07d94a7fce57
4
+ data.tar.gz: c152d9f206b4344a4b1e80ade4226aa9091b8f47276c2a2bea1b58438ab6e565
5
5
  SHA512:
6
- metadata.gz: 6ccf00e83ea0fc8da9fb80b989c16dcfd3b34780359bdc5d6e442041c591dafd3066c14abfa68cfd6d72c1fc3012ce9fced3ef8a71c13c6e236bec788fe679c0
7
- data.tar.gz: 6e9290bbc3c01f72f1b3414a3b74fb2040d547b5fac2762c1ff4ecee1ff1eb40b49e6205319f276cd593c96401417098246842be69ae7dfc13f91d71bc2bbb84
6
+ metadata.gz: a4f05feb79259fd2b180da65ad57e1d3d68ced2c7af41bd48fa76d72076835d8d1667d7aee8a560094f8064a310bc6e24dbb1e0b8b43be664e32ef527c9e11f6
7
+ data.tar.gz: 4a4add874ab8848a38902f2a964a07bf61b959d5b4b205f9843ff1298cf1fca67f637fc408a3693ea4f1e97ca16ded2d8c040fceab22be96c4e65e1413da86de
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- emp_json (1.4.0.pre.g4cafffeae)
4
+ emp_json (1.4.0.pre.g8ecc8d148)
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
@@ -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.g4cafffeae
4
+ version: 1.4.0.pre.g8ecc8d148
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: