Class: Lockdown::Controller
- Inherits:
-
Object
- Object
- Lockdown::Controller
- Defined in:
- lib/lockdown/permission.rb
Instance Attribute Summary collapse
-
#access_methods ⇒ Object
Returns the value of attribute access_methods.
-
#except_methods ⇒ Object
Returns the value of attribute except_methods.
-
#name ⇒ Object
Returns the value of attribute name.
-
#only_methods ⇒ Object
Returns the value of attribute only_methods.
Instance Method Summary collapse
-
#initialize(name) ⇒ Controller
constructor
A new instance of Controller.
- #set_access_methods ⇒ Object
Constructor Details
#initialize(name) ⇒ Controller
Returns a new instance of Controller.
5 6 7 8 |
# File 'lib/lockdown/permission.rb', line 5 def initialize(name) @name = name @except_methods = [] end |
Instance Attribute Details
#access_methods ⇒ Object
Returns the value of attribute access_methods.
3 4 5 |
# File 'lib/lockdown/permission.rb', line 3 def access_methods @access_methods end |
#except_methods ⇒ Object
Returns the value of attribute except_methods.
3 4 5 |
# File 'lib/lockdown/permission.rb', line 3 def except_methods @except_methods end |
#name ⇒ Object
Returns the value of attribute name.
3 4 5 |
# File 'lib/lockdown/permission.rb', line 3 def name @name end |
#only_methods ⇒ Object
Returns the value of attribute only_methods.
3 4 5 |
# File 'lib/lockdown/permission.rb', line 3 def only_methods @only_methods end |
Instance Method Details
#set_access_methods ⇒ Object
10 11 12 13 14 15 16 17 18 |
# File 'lib/lockdown/permission.rb', line 10 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 |