Class: Lockdown::Controller

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name) ⇒ Controller

Returns a new instance of Controller.



8
9
10
11
# File 'lib/lockdown/permission.rb', line 8

def initialize(name)
  @name = name
  @except_methods = []
end

Instance Attribute Details

#access_methodsObject

Returns the value of attribute access_methods.



6
7
8
# File 'lib/lockdown/permission.rb', line 6

def access_methods
  @access_methods
end

#except_methodsObject

Returns the value of attribute except_methods.



6
7
8
# File 'lib/lockdown/permission.rb', line 6

def except_methods
  @except_methods
end

#nameObject

Returns the value of attribute name.



6
7
8
# File 'lib/lockdown/permission.rb', line 6

def name
  @name
end

#only_methodsObject

Returns the value of attribute only_methods.



6
7
8
# File 'lib/lockdown/permission.rb', line 6

def only_methods
  @only_methods
end

Instance Method Details

#set_access_methodsObject



13
14
15
16
17
18
19
20
21
# File 'lib/lockdown/permission.rb', line 13

def set_access_methods
  if @only_methods
    @access_methods = paths_for(@name, *@only_methods)
  else
    @access_methods = paths_for(@name)
  end

  apply_exceptions if @except_methods.length > 0
end