Class: Ckeditor::PicturePolicy
- Inherits:
-
ApplicationPolicy
- Object
- ApplicationPolicy
- Ckeditor::PicturePolicy
- Defined in:
- lib/generators/ckeditor/templates/action_policy/picture_policy.rb,
lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb
Instance Attribute Summary collapse
-
#picture ⇒ Object
readonly
Returns the value of attribute picture.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Instance Method Summary collapse
- #create? ⇒ Boolean
- #destroy? ⇒ Boolean
- #index? ⇒ Boolean
-
#initialize(user, picture) ⇒ PicturePolicy
constructor
A new instance of PicturePolicy.
Constructor Details
#initialize(user, picture) ⇒ PicturePolicy
Returns a new instance of PicturePolicy.
6 7 8 9 |
# File 'lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb', line 6 def initialize(user, picture) @user = user @picture = picture end |
Instance Attribute Details
#picture ⇒ Object (readonly)
Returns the value of attribute picture.
4 5 6 |
# File 'lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb', line 4 def picture @picture end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
4 5 6 |
# File 'lib/generators/ckeditor/templates/pundit_policy/picture_policy.rb', line 4 def user @user end |
Instance Method Details
#create? ⇒ Boolean
11 12 13 |
# File 'lib/generators/ckeditor/templates/action_policy/picture_policy.rb', line 11 def create? user.present? end |
#destroy? ⇒ Boolean
15 16 17 |
# File 'lib/generators/ckeditor/templates/action_policy/picture_policy.rb', line 15 def destroy? user.present? end |
#index? ⇒ Boolean
7 8 9 |
# File 'lib/generators/ckeditor/templates/action_policy/picture_policy.rb', line 7 def index? user.present? end |