Class: ActiveTriples::Schema

Inherits:
Object
  • Object
show all
Defined in:
lib/active_triples/schema.rb

Overview

Super class which provides a simple property DSL for defining property -> predicate mappings.

Class Method Summary collapse

Class Method Details

.propertiesObject



16
17
18
# File 'lib/active_triples/schema.rb', line 16

def properties
  @properties ||= []
end

.property(property, options) ⇒ Object

Parameters:

  • property (Symbol)

    The property name on the object.

  • options (Hash)

    Options for the property.

Options Hash (options):

  • :predicate (RDF::URI)

    The predicate to map the property to.



12
13
14
# File 'lib/active_triples/schema.rb', line 12

def property(property, options)
  properties << Property.new(options.merge(:name => property))
end