Class: ActionPolicy::Testing::AuthorizeTracker::Scoping
- Inherits:
-
Object
- Object
- ActionPolicy::Testing::AuthorizeTracker::Scoping
- Defined in:
- lib/action_policy/testing.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#policy ⇒ Object
readonly
Returns the value of attribute policy.
-
#scope_options ⇒ Object
readonly
Returns the value of attribute scope_options.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Instance Method Summary collapse
-
#initialize(policy, target, type, name, scope_options) ⇒ Scoping
constructor
A new instance of Scoping.
- #inspect ⇒ Object
- #matches?(policy_class, actual_type, actual_name, actual_scope_options) ⇒ Boolean
Constructor Details
#initialize(policy, target, type, name, scope_options) ⇒ Scoping
Returns a new instance of Scoping.
39 40 41 42 43 44 45 |
# File 'lib/action_policy/testing.rb', line 39 def initialize(policy, target, type, name, ) @policy = policy @target = target @type = type @name = name @scope_options = end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
37 38 39 |
# File 'lib/action_policy/testing.rb', line 37 def name @name end |
#policy ⇒ Object (readonly)
Returns the value of attribute policy.
37 38 39 |
# File 'lib/action_policy/testing.rb', line 37 def policy @policy end |
#scope_options ⇒ Object (readonly)
Returns the value of attribute scope_options.
37 38 39 |
# File 'lib/action_policy/testing.rb', line 37 def @scope_options end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
37 38 39 |
# File 'lib/action_policy/testing.rb', line 37 def target @target end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
37 38 39 |
# File 'lib/action_policy/testing.rb', line 37 def type @type end |
Instance Method Details
#inspect ⇒ Object
54 55 56 |
# File 'lib/action_policy/testing.rb', line 54 def inspect "#{policy.class} :#{name} for :#{type} #{}" end |
#matches?(policy_class, actual_type, actual_name, actual_scope_options) ⇒ Boolean
47 48 49 50 51 52 |
# File 'lib/action_policy/testing.rb', line 47 def matches?(policy_class, actual_type, actual_name, ) policy_class == policy.class && type == actual_type && name == actual_name && === end |