Class: RoleStrategy::ActiveRecord::RolesMask::Implementation::Roles
- Inherits:
-
Set
- Object
- Set
- RoleStrategy::ActiveRecord::RolesMask::Implementation::Roles
- Defined in:
- lib/roles_active_record/strategy/multi/roles_mask.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#model_instance ⇒ Object
readonly
Returns the value of attribute model_instance.
Instance Method Summary collapse
- #<<(role) ⇒ Object
-
#initialize(sender, *roles) ⇒ Roles
constructor
A new instance of Roles.
Constructor Details
#initialize(sender, *roles) ⇒ Roles
Returns a new instance of Roles.
49 50 51 52 |
# File 'lib/roles_active_record/strategy/multi/roles_mask.rb', line 49 def initialize(sender, *roles) super(*roles) @model_instance = sender end |
Instance Attribute Details
#model_instance ⇒ Object (readonly)
Returns the value of attribute model_instance.
47 48 49 |
# File 'lib/roles_active_record/strategy/multi/roles_mask.rb', line 47 def model_instance @model_instance end |
Instance Method Details
#<<(role) ⇒ Object
54 55 56 57 |
# File 'lib/roles_active_record/strategy/multi/roles_mask.rb', line 54 def <<(role) model_instance.roles = super.to_a self end |