Module: Troles::Common::Operations::Write
- Included in:
- Troles::Common::Operations
- Defined in:
- lib/troles/common/operations/write.rb
Instance Method Summary collapse
-
#+(*roles) ⇒ true, ...
(also: #<<, #add, #add!)
Add a set of roles to the role subject.
-
#-(*roles) ⇒ true, ...
(also: #remove, #remove!)
Remove a set of roles from the role subject.
-
#==(*roles) ⇒ Object
(also: #equal, #same_as)
Test roles equality.
-
#clear ⇒ true, ...
(also: #clear!)
Clear all the roles from the role subject.
Instance Method Details
#+(*roles) ⇒ true, ... Also known as: <<, add, add!
Add a set of roles to the role subject
17 18 19 |
# File 'lib/troles/common/operations/write.rb', line 17 def + *roles role_subject.add_roles roles end |
#-(*roles) ⇒ true, ... Also known as: remove, remove!
Remove a set of roles from the role subject
27 28 29 |
# File 'lib/troles/common/operations/write.rb', line 27 def - *roles role_subject.remove_roles roles end |
#==(*roles) ⇒ Object Also known as: equal, same_as
Test roles equality
8 9 10 |
# File 'lib/troles/common/operations/write.rb', line 8 def == *roles role_subject.role_list == roles.flatten end |
#clear ⇒ true, ... Also known as: clear!
Clear all the roles from the role subject
36 37 38 |
# File 'lib/troles/common/operations/write.rb', line 36 def clear role_subject.clear_roles! end |