Sha256: 98e927ba17b431c3368e92d8196daa26b2298c16c3f945b8aa6a08cb5494e13f
Contents?: true
Size: 696 Bytes
Versions: 12
Compression:
Stored size: 696 Bytes
Contents
module Spira::Types ## # A {Spira::Type} for Boolean values. Values will be expressed as booleans # and packaged as `XSD.boolean` `RDF::Literal`s. # # A {Spira::Resource} property can reference this type as # `Spira::Types::Boolean`, `Boolean`, or `XSD.boolean`. # # @see Spira::Type # @see http://rdf.rubyforge.org/RDF/Literal.html class Boolean include Spira::Type def self.unserialize(value) value.object == true end def self.serialize(value) if value RDF::Literal.new(true, :datatype => XSD.boolean) else RDF::Literal.new(false, :datatype => XSD.boolean) end end register_alias XSD.boolean end end
Version data entries
12 entries across 12 versions & 1 rubygems