Class: GrapeSwaggerRails::Options

Inherits:
OpenStruct
  • Object
show all
Defined in:
lib/grape-swagger-rails.rb

Instance Method Summary collapse

Instance Method Details

#before_action(&block) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/grape-swagger-rails.rb', line 16

def before_action(&block)
  if block_given?
    self.before_action_proc = block
  else
    before_action_proc
  end
end

#before_filter(&block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/grape-swagger-rails.rb', line 8

def before_filter(&block)
  GrapeSwaggerRails.deprecator.warn(
    'This option is deprecated and going to be removed in 1.0.0. ' \
    'Please use `before_action` instead'
  )
  before_action(&block)
end