Class: Trinity::Handler::Dispatcher

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

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)



4
5
6
7
8
9
10
# File 'lib/trinity/handler/dispatcher.rb', line 4

def call(env)
  if (resource = Trinity::Resource.new(env['trinity.subject'], env['trinity.data'])).found?
    resource.render(env)
  else
    not_found
  end
end