Module: Sinatra::RDF

Defined in:
vendor/bundler/ruby/3.3.0/bundler/gems/sinatra-rdf-bce6fb86e235/lib/sinatra/rdf.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

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
# File 'vendor/bundler/ruby/3.3.0/bundler/gems/sinatra-rdf-bce6fb86e235/lib/sinatra/rdf.rb', line 28

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