Created
October 4, 2011 13:45
-
-
Save abrisse/1261681 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Spira::Types | |
## | |
# A {Spira::Type} for integer values. Values will be associated with the | |
# `XSD.integer` type. | |
# | |
# A {Spira::Resource} property can reference this type as | |
# `Spira::Types::Integer`, `Integer`, or `XSD.integer`. | |
# | |
# @see Spira::Type | |
# @see http://rdf.rubyforge.org/RDF/Literal.html | |
class Integer | |
include Spira::Type | |
def self.unserialize(value) | |
value.object.to_i | |
end | |
def self.serialize(value) | |
RDF::Literal.new(value) | |
end | |
register_alias XSD.integer | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment