Module: Sinatra::LinkedData

Defined in:
lib/sinatra/linkeddata.rb,
lib/sinatra/linkeddata/version.rb

Overview

To override negotiation on Content-Type, set :format in linkeddata_options to a RDF Format class, or symbol identifying a format.

Defined Under Namespace

Modules: Helpers, VERSION

Class Method Summary collapse

Class Method Details

.registered(app)

This method returns an undefined value.

  • Registers Rack::LinkedData::ContentNegotiation

  • adds helpers

  • includes RDF and LinkedData

  • defines linkeddata_options, which are passed to the Rack middleware available as settings.linkeddata_options and as options within the LinkedData Rack middleware.

Parameters:

  • app (Sinatra::Base)


28
29
30
31
32
33
34
35
# File 'lib/sinatra/linkeddata.rb', line 28

def self.registered(app)
  options = {}
  app.set :linkeddata_options, options
  app.use(Rack::LinkedData::ContentNegotiation, options)
  app.helpers(Sinatra::LinkedData::Helpers)
  app.send(:include, ::RDF)
  app.send(:include, ::LinkedData)
end