Class: RoleModel::Roles
- Inherits:
-
Set
- Object
- Set
- RoleModel::Roles
- Defined in:
- lib/role_model/roles.rb
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.
7 8 9 10 |
# File 'lib/role_model/roles.rb', line 7 def initialize(sender, *roles) super(*roles) @model_instance = sender end |
Instance Attribute Details
#model_instance ⇒ Object (readonly)
Returns the value of attribute model_instance.
5 6 7 |
# File 'lib/role_model/roles.rb', line 5 def model_instance @model_instance end |
Instance Method Details
#<<(role) ⇒ Object
12 13 14 15 |
# File 'lib/role_model/roles.rb', line 12 def <<(role) model_instance.roles = super.to_a self end |