spira 2.0.2 → 2.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/VERSION +1 -1
- data/lib/spira/types/double.rb +27 -0
- data/lib/spira/types/float.rb +4 -6
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 60a2f2001ee3ca4803b5c0f10dd0ee95be394583
|
4
|
+
data.tar.gz: 4fd45e81ca7128e36b97a08701ee2dacbec31f82
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 74b6ff7e40373eb2e704f64ff1e3602b60f17ea5042b27189199052f5a47989aa0a894075de4a4d6b4bb35fcd8b7ec0b5631213694058778ba3f3a67482bd326
|
7
|
+
data.tar.gz: 0664e654b6331a8003cc676e7b026ca31d8b3a39159ed6a010eebf776324cec9a07e79aaee61185f2575f323b1d5fe7459747aa08507ad9fed92ed337d5fa6a7
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
2.0
|
1
|
+
2.1.0
|
@@ -0,0 +1,27 @@
|
|
1
|
+
module Spira::Types
|
2
|
+
|
3
|
+
##
|
4
|
+
# A {Spira::Type} for Double values. Values will be associated with the
|
5
|
+
# `XSD.double` type.
|
6
|
+
#
|
7
|
+
# A {Spira::Resource} property can reference this type as
|
8
|
+
# `Spira::Types::Double`, `Double`, or `XSD.double`.
|
9
|
+
#
|
10
|
+
# @see Spira::Type
|
11
|
+
# @see http://rdf.rubyforge.org/RDF/Literal.html
|
12
|
+
class Double
|
13
|
+
|
14
|
+
include Spira::Type
|
15
|
+
|
16
|
+
def self.unserialize(value)
|
17
|
+
value.object.to_f
|
18
|
+
end
|
19
|
+
|
20
|
+
def self.serialize(value)
|
21
|
+
RDF::Literal.new(value.to_f, :datatype => RDF::XSD.double)
|
22
|
+
end
|
23
|
+
|
24
|
+
register_alias RDF::XSD.double
|
25
|
+
|
26
|
+
end
|
27
|
+
end
|
data/lib/spira/types/float.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Spira::Types
|
2
2
|
|
3
3
|
##
|
4
|
-
# A {Spira::Type} for Float values.
|
5
|
-
# `XSD.
|
4
|
+
# A {Spira::Type} for Float values. Values will be associated with the
|
5
|
+
# `XSD.float` type.
|
6
6
|
#
|
7
7
|
# A {Spira::Resource} property can reference this type as
|
8
|
-
# `Spira::Types::Float`, `Float`,
|
8
|
+
# `Spira::Types::Float`, `Float`, or `XSD.float`.
|
9
9
|
#
|
10
10
|
# @see Spira::Type
|
11
11
|
# @see http://rdf.rubyforge.org/RDF/Literal.html
|
@@ -18,11 +18,9 @@ module Spira::Types
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def self.serialize(value)
|
21
|
-
RDF::Literal.new(value.to_f, :datatype => RDF::XSD.
|
21
|
+
RDF::Literal.new(value.to_f, :datatype => RDF::XSD.float)
|
22
22
|
end
|
23
23
|
|
24
24
|
register_alias RDF::XSD.float
|
25
|
-
register_alias RDF::XSD.double
|
26
|
-
|
27
25
|
end
|
28
26
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: spira
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.0
|
4
|
+
version: 2.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ben Lavender
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir:
|
10
10
|
- bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2017-
|
12
|
+
date: 2017-03-01 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rdf
|
@@ -194,6 +194,7 @@ files:
|
|
194
194
|
- lib/spira/types/date.rb
|
195
195
|
- lib/spira/types/dateTime.rb
|
196
196
|
- lib/spira/types/decimal.rb
|
197
|
+
- lib/spira/types/double.rb
|
197
198
|
- lib/spira/types/float.rb
|
198
199
|
- lib/spira/types/gYear.rb
|
199
200
|
- lib/spira/types/int.rb
|