module Spira::Type::ClassMethods

Public Instance Methods

register_alias(identifier) click to toggle source

Register an alias that this type can be referred to as, such as an RDF URI. The alias can be any object, symbol, or constant.

@param [Any] identifier The new alias in property declarations for this class @return [Void]

# File lib/spira/type.rb, line 58
def register_alias(identifier)
  Spira.type_alias(identifier, self)
end
serialize(value) click to toggle source

Serialize a given value to RDF.

@param [Any] value The Ruby value to be serialized @return [RDF::Value] The RDF form of this value

# File lib/spira/type.rb, line 67
def serialize(value)
  value
end
unserialize(value) click to toggle source

Unserialize a given RDF value to Ruby

@param [RDF::Value] value The RDF form of this value @return [Any] The Ruby form of this value

# File lib/spira/type.rb, line 76
def unserialize(value)
  value
end