Class: Garage::Permission

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

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#actionObject

Returns the value of attribute action.



3
4
5
# File 'lib/garage/permission.rb', line 3

def action
  @action
end

#userObject

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

Returns:

  • (Boolean)


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

def allowed?
  @perm == :ok
end