Class: Trinity::Handler::Aliaser

Inherits:
Trinity::Handler show all
Defined in:
lib/trinity/handler/aliaser.rb

Overview

If a resource has been declared to be the same as another resource change the current request subject to be that resource instead.

See Also:

Instance Method Summary

Methods inherited from Trinity::Handler

#initialize, #not_found, #query, #redirect

Constructor Details

This class inherits a constructor from Trinity::Handler

Instance Method Details

- (Object) call(env)



8
9
10
11
12
13
# File 'lib/trinity/handler/aliaser.rb', line 8

def call(env)
  query([env['trinity.subject'], RDF::OWL.sameAs]).each do |statement|
    env['trinity.subject'] = statement.object
  end
  super
end