Module: Sinatra::Nedry

Defined in:
lib/sinatra/nedry.rb

Instance Method Summary collapse

Instance Method Details

#flagged!(&blk) ⇒ Object



11
12
13
14
15
16
17
# File 'lib/sinatra/nedry.rb', line 11

def flagged!(&blk)
  if authorized? || ENV["RACK_ENV"] != "production"
    blk.call
  else
    not_authorized
  end
end

#protected!(&blk) ⇒ Object



3
4
5
6
7
8
9
# File 'lib/sinatra/nedry.rb', line 3

def protected!(&blk)
  if authorized?
    blk.call
  else
    not_authorized
  end
end