Class: Barristan::Guarded

Inherits:
Object
  • Object
show all
Defined in:
lib/barristan.rb

Instance Method Summary collapse

Instance Method Details

#authorized(&block) ⇒ Object



39
40
41
# File 'lib/barristan.rb', line 39

def authorized(&block)
  @authorized = block
end

#authorized!Object



43
44
45
# File 'lib/barristan.rb', line 43

def authorized!
  @authorized.call
end

#forbidden(&block) ⇒ Object



35
36
37
# File 'lib/barristan.rb', line 35

def forbidden(&block)
  @forbidden = block
end

#forbidden!Object



47
48
49
# File 'lib/barristan.rb', line 47

def forbidden!
  @forbidden.call
end