Module: Spira
- Defined in:
- lib/spira.rb,
lib/spira/base.rb,
lib/spira/type.rb,
lib/spira/types.rb,
lib/spira/utils.rb,
lib/spira/version.rb,
lib/spira/resource.rb,
lib/spira/exceptions.rb,
lib/spira/persistence.rb,
lib/spira/reflections.rb,
lib/spira/validations.rb,
lib/spira/serialization.rb,
lib/spira/validations/uniqueness.rb
Overview
Spira is a framework for building projections of RDF data into Ruby classes. It is built on top of RDF.rb.
Defined Under Namespace
Modules: Persistence, Reflections, Resource, Serialization, Type, Types, Utils, VERSION, Validations Classes: Base, NoRepositoryError, NoTypeError, PropertyMissingError, RecordInvalid, RecordNotSaved, ResourceDeclarationError, SpiraError
Class Method Summary collapse
-
.repository ⇒ RDF::Repository
The RDF::Repository used (reader).
-
.repository=(repository) ⇒ RDF::Repository
The RDF::Repository used (reader).
-
.type_alias(new, original) ⇒ Void
Alias a property type to another.
-
.types ⇒ Hash{Symbol => Spira::Type}
The list of all property types available for Spira resources.
-
.using_repository(repo) { ... } ⇒ RDF::Repository
Execute a block on a specific repository.
Class Method Details
.repository ⇒ RDF::Repository
The RDF::Repository used (reader)
38 39 40 |
# File 'lib/spira.rb', line 38 def repository Thread.current[:repository] end |
.repository=(repository) ⇒ RDF::Repository
The RDF::Repository used (reader)
48 49 50 |
# File 'lib/spira.rb', line 48 def repository=(repository) Thread.current[:repository] = repository end |
.type_alias(new, original) ⇒ Void
Alias a property type to another. This allows a range of options to be specified for a property type which all reference one Spira::Type
88 89 90 |
# File 'lib/spira.rb', line 88 def type_alias(new, original) types[new] = original end |
.types ⇒ Hash{Symbol => Spira::Type}
The list of all property types available for Spira resources
28 29 30 |
# File 'lib/spira.rb', line 28 def types @types ||= {} end |
.using_repository(repo) { ... } ⇒ RDF::Repository
Execute a block on a specific repository
69 70 71 72 73 74 75 76 |
# File 'lib/spira.rb', line 69 def using_repository(repo) old_repository = Spira.repository Spira.repository = repo yield if block_given? repo ensure Spira.repository = old_repository end |