Class: Europeana::Blacklight::Routes

Inherits:
Object
  • Object
show all
Defined in:
lib/europeana/blacklight/routes.rb

Overview

URL routing for Europeana records

Instance Method Summary collapse

Constructor Details

#initialize(defaults = {}) ⇒ Routes

Returns a new instance of Routes.



8
9
10
# File 'lib/europeana/blacklight/routes.rb', line 8

def initialize(defaults = {})
  @defaults = defaults
end

Instance Method Details

#call(mapper, _options = {}) ⇒ Object



12
13
14
15
16
17
# File 'lib/europeana/blacklight/routes.rb', line 12

def call(mapper, _options = {})
  mapper.constraints id: %r{[^/]+/[^/]+} do
    mapper.post 'record/*id/track', action: 'track', as: 'track'
    mapper.get 'record/*id', action: 'show', as: 'show'
  end
end