Class: Blacklight::Routes::Exportable

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

Instance Method Summary collapse

Constructor Details

#initialize(defaults = {}) ⇒ Exportable

Returns a new instance of Exportable.



6
7
8
# File 'lib/blacklight/routes/exportable.rb', line 6

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

Instance Method Details

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



10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'lib/blacklight/routes/exportable.rb', line 10

def call(mapper, _options = {})
  mapper.member do
    mapper.match 'email', via: [:get, :post]
    mapper.match 'sms', via: [:get, :post]
    mapper.get 'citation'
  end

  mapper.collection do
    mapper.match 'email', via: [:get, :post]
    mapper.match 'sms', via: [:get, :post]
    mapper.get 'citation'
  end
end