Class: J2119::RoleConstraints
- Inherits:
-
Object
- Object
- J2119::RoleConstraints
- Defined in:
- lib/j2119/role_constraints.rb
Overview
Just a hash to remember constraints
Instance Method Summary collapse
- #add(role, constraint) ⇒ Object
- #get_constraints(role) ⇒ Object
-
#initialize ⇒ RoleConstraints
constructor
A new instance of RoleConstraints.
Constructor Details
#initialize ⇒ RoleConstraints
Returns a new instance of RoleConstraints.
18 19 20 |
# File 'lib/j2119/role_constraints.rb', line 18 def initialize @constraints = {} end |
Instance Method Details
#add(role, constraint) ⇒ Object
22 23 24 25 |
# File 'lib/j2119/role_constraints.rb', line 22 def add(role, constraint) @constraints[role] ||= [] @constraints[role] << constraint end |
#get_constraints(role) ⇒ Object
27 28 29 |
# File 'lib/j2119/role_constraints.rb', line 27 def get_constraints(role) @constraints[role] || [] end |