Module: Spira::Type::ClassMethods
- Defined in:
- lib/spira/type.rb
Instance Method Summary collapse
-
#register_alias(identifier) ⇒ Void
Register an alias that this type can be referred to as, such as an RDF URI.
-
#serialize(value) ⇒ RDF::Value
Serialize a given value to RDF.
-
#unserialize(value) ⇒ Any
Unserialize a given RDF value to Ruby.
Instance Method Details
#register_alias(identifier) ⇒ Void
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.
58 59 60 |
# File 'lib/spira/type.rb', line 58 def register_alias(identifier) Spira.type_alias(identifier, self) end |
#serialize(value) ⇒ RDF::Value
Serialize a given value to RDF.
67 68 69 |
# File 'lib/spira/type.rb', line 67 def serialize(value) value end |
#unserialize(value) ⇒ Any
Unserialize a given RDF value to Ruby
76 77 78 |
# File 'lib/spira/type.rb', line 76 def unserialize(value) value end |