Module: Neo::DCI::Role

Included in:
Role
Defined in:
lib/neo/dci/role.rb

Defined Under Namespace

Classes: NotAssignable

Instance Method Summary collapse

Instance Method Details

#assignable_to?(object, *params) ⇒ Boolean

Decides if the role is assignable to object.

The decision can determined by object and params.

Returns true by default so every object can have that role.

Returns:

  • (Boolean)


36
37
38
# File 'lib/neo/dci/role.rb', line 36

def assignable_to?(object, *params)
  true
end

#role_assigned(object, *params) ⇒ Object

Hook after a role has been assigned.

Useful for extend the role with other roles.



43
44
# File 'lib/neo/dci/role.rb', line 43

def role_assigned(object, *params)
end