spira 2.0.2 → 2.1.0

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: 2d1bbcb90911e3e4a33ef723d1f4d617541a7b49
4
- data.tar.gz: beab46e2b3baee71de96c5a0a3d44726b1a49f59
3
+ metadata.gz: 60a2f2001ee3ca4803b5c0f10dd0ee95be394583
4
+ data.tar.gz: 4fd45e81ca7128e36b97a08701ee2dacbec31f82
5
5
  SHA512:
6
- metadata.gz: e2cc68b3c7a3d2bbb256cf21811345dd7968a617665e7a96bb8e41f20a25043dd8115e89d88891ce171caabc32d75428a9253320fb66484db619a113b6e76cf6
7
- data.tar.gz: cfa2f2999c35bfcd18ed73c3444e00c4990cb3e686aa3e4c4c2193f9fc1d1d9f30a64d5a1c5d6acbfb1a30d818e2468a8469ab60b18b71e1f85758368f36c259
6
+ metadata.gz: 74b6ff7e40373eb2e704f64ff1e3602b60f17ea5042b27189199052f5a47989aa0a894075de4a4d6b4bb35fcd8b7ec0b5631213694058778ba3f3a67482bd326
7
+ data.tar.gz: 0664e654b6331a8003cc676e7b026ca31d8b3a39159ed6a010eebf776324cec9a07e79aaee61185f2575f323b1d5fe7459747aa08507ad9fed92ed337d5fa6a7
data/VERSION CHANGED
@@ -1 +1 @@
1
- 2.0.2
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
@@ -1,11 +1,11 @@
1
1
  module Spira::Types
2
2
 
3
3
  ##
4
- # A {Spira::Type} for Float values. Values will be associated with the
5
- # `XSD.double` type.
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`, `XSD.double`, or `XSD.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.double)
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.2
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-02-22 00:00:00.000000000 Z
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