Class: Distribuo::ApplicationPolicy
- Inherits:
-
Object
- Object
- Distribuo::ApplicationPolicy
- Defined in:
- app/policies/distribuo/application_policy.rb
Direct Known Subclasses
Defined Under Namespace
Classes: Scope
Instance Attribute Summary collapse
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #create? ⇒ Boolean
- #destroy? ⇒ Boolean
- #edit? ⇒ Boolean
- #event? ⇒ Boolean
- #index? ⇒ Boolean
-
#initialize(user, record) ⇒ ApplicationPolicy
constructor
A new instance of ApplicationPolicy.
- #new? ⇒ Boolean
- #show? ⇒ Boolean
- #update? ⇒ Boolean
Constructor Details
#initialize(user, record) ⇒ ApplicationPolicy
Returns a new instance of ApplicationPolicy.
7 8 9 10 |
# File 'app/policies/distribuo/application_policy.rb', line 7 def initialize(user, record) @user = user @record = record end |
Instance Attribute Details
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'app/policies/distribuo/application_policy.rb', line 5 def record @record end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'app/policies/distribuo/application_policy.rb', line 5 def user @user end |
Instance Method Details
#create? ⇒ Boolean
20 21 22 |
# File 'app/policies/distribuo/application_policy.rb', line 20 def create? true end |
#destroy? ⇒ Boolean
36 37 38 |
# File 'app/policies/distribuo/application_policy.rb', line 36 def destroy? false end |
#edit? ⇒ Boolean
32 33 34 |
# File 'app/policies/distribuo/application_policy.rb', line 32 def edit? update? end |
#event? ⇒ Boolean
40 41 42 |
# File 'app/policies/distribuo/application_policy.rb', line 40 def event? update? end |
#index? ⇒ Boolean
12 13 14 |
# File 'app/policies/distribuo/application_policy.rb', line 12 def index? true end |
#new? ⇒ Boolean
24 25 26 |
# File 'app/policies/distribuo/application_policy.rb', line 24 def new? create? end |
#show? ⇒ Boolean
16 17 18 |
# File 'app/policies/distribuo/application_policy.rb', line 16 def show? true end |
#update? ⇒ Boolean
28 29 30 |
# File 'app/policies/distribuo/application_policy.rb', line 28 def update? true end |