Class: LucidPolicy::Helper

Inherits:
BasicObject
Defined in:
lib/isomorfeus_policy/lucid_policy/helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeHelper

Returns a new instance of Helper.



5
6
7
# File 'lib/isomorfeus_policy/lucid_policy/helper.rb', line 5

def initialize
  @result = :deny
end

Instance Attribute Details

#resultObject (readonly)

Returns the value of attribute result.



3
4
5
# File 'lib/isomorfeus_policy/lucid_policy/helper.rb', line 3

def result
  @result
end

Instance Method Details

#allowObject



9
10
11
12
# File 'lib/isomorfeus_policy/lucid_policy/helper.rb', line 9

def allow
  @result = :allow
  nil
end

#current_userObject



18
19
20
# File 'lib/isomorfeus_policy/lucid_policy/helper.rb', line 18

def current_user
  Isomorfeus.current_user
end

#denyObject



14
15
16
# File 'lib/isomorfeus_policy/lucid_policy/helper.rb', line 14

def deny
  nil
end