Class: Glib::ApplicationPolicy
- Inherits:
-
Object
- Object
- Glib::ApplicationPolicy
- Defined in:
- app/policies/glib/application_policy.rb
Defined Under Namespace
Classes: Scope
Class Attribute Summary collapse
-
.catch_all ⇒ Object
readonly
Returns the value of attribute catch_all.
Instance Attribute Summary collapse
-
#controller ⇒ Object
readonly
Returns the value of attribute controller.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#record ⇒ Object
readonly
Returns the value of attribute record.
-
#request ⇒ Object
readonly
Returns the value of attribute request.
-
#user ⇒ Object
readonly
Returns the value of attribute user.
Class Method Summary collapse
Instance Method Summary collapse
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(name, *args, &block) ⇒ Object
99 100 101 102 103 104 105 |
# File 'app/policies/glib/application_policy.rb', line 99 def method_missing(name, *args, &block) if name.to_s.end_with?('?') && catch_all call_catch_all else super end end |
Class Attribute Details
.catch_all ⇒ Object (readonly)
Returns the value of attribute catch_all.
19 20 21 |
# File 'app/policies/glib/application_policy.rb', line 19 def catch_all @catch_all end |
Instance Attribute Details
#controller ⇒ Object (readonly)
Returns the value of attribute controller.
5 6 7 |
# File 'app/policies/glib/application_policy.rb', line 5 def controller @controller end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'app/policies/glib/application_policy.rb', line 5 def params @params end |
#record ⇒ Object (readonly)
Returns the value of attribute record.
5 6 7 |
# File 'app/policies/glib/application_policy.rb', line 5 def record @record end |
#request ⇒ Object (readonly)
Returns the value of attribute request.
5 6 7 |
# File 'app/policies/glib/application_policy.rb', line 5 def request @request end |
#user ⇒ Object (readonly)
Returns the value of attribute user.
5 6 7 |
# File 'app/policies/glib/application_policy.rb', line 5 def user @user end |
Class Method Details
.args_builder ⇒ Object
131 132 133 |
# File 'app/policies/glib/application_policy.rb', line 131 def self.args_builder Proc.new { |controller| [] } end |
Instance Method Details
#scope ⇒ Object
108 109 110 |
# File 'app/policies/glib/application_policy.rb', line 108 def scope Pundit.policy_scope!(user, record.class) end |