Class: Roleback::Definitions::RuleBased
- Inherits:
-
Object
- Object
- Roleback::Definitions::RuleBased
- Defined in:
- lib/roleback/definitions/rule_based.rb
Instance Attribute Summary collapse
-
#resource ⇒ Object
readonly
Returns the value of attribute resource.
-
#role ⇒ Object
readonly
Returns the value of attribute role.
Instance Method Summary collapse
- #<=>(other) ⇒ Object
- #can(action) ⇒ Object
- #cannot(action) ⇒ Object
-
#initialize(role:, resource:, scope:) ⇒ RuleBased
constructor
A new instance of RuleBased.
Constructor Details
#initialize(role:, resource:, scope:) ⇒ RuleBased
Returns a new instance of RuleBased.
7 8 9 10 11 |
# File 'lib/roleback/definitions/rule_based.rb', line 7 def initialize(role:, resource:, scope:) @role = role @resource = resource @scope = scope end |
Instance Attribute Details
#resource ⇒ Object (readonly)
Returns the value of attribute resource.
5 6 7 |
# File 'lib/roleback/definitions/rule_based.rb', line 5 def resource @resource end |
#role ⇒ Object (readonly)
Returns the value of attribute role.
4 5 6 |
# File 'lib/roleback/definitions/rule_based.rb', line 4 def role @role end |
Instance Method Details
#<=>(other) ⇒ Object
21 22 23 |
# File 'lib/roleback/definitions/rule_based.rb', line 21 def <=>(other) other.numerical_value <=> numerical_value end |