Class: Garage::Permission
- Inherits:
-
Object
- Object
- Garage::Permission
- Defined in:
- lib/garage/permission.rb
Instance Attribute Summary collapse
-
#action ⇒ Object
Returns the value of attribute action.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #allowed? ⇒ Boolean
-
#initialize(*args) ⇒ Permission
constructor
A new instance of Permission.
Constructor Details
#initialize(*args) ⇒ Permission
Returns a new instance of Permission.
5 6 7 |
# File 'lib/garage/permission.rb', line 5 def initialize(*args) @user, @action, @perm = *args end |
Instance Attribute Details
#action ⇒ Object
Returns the value of attribute action.
3 4 5 |
# File 'lib/garage/permission.rb', line 3 def action @action end |
#user ⇒ Object
Returns the value of attribute user.
3 4 5 |
# File 'lib/garage/permission.rb', line 3 def user @user end |
Instance Method Details
#allowed? ⇒ Boolean
9 10 11 |
# File 'lib/garage/permission.rb', line 9 def allowed? @perm == :ok end |