Module: Tiun::Actor
- Defined in:
- lib/tiun/actor.rb
Defined Under Namespace
Modules: Validate
Classes: InvalidActorKindError, InvalidContextKindForActorError
Constant Summary
collapse
- AUTOMAP =
{
Validate: "tiun/actor/validate",
}
Class Method Summary
collapse
Class Method Details
16
17
18
19
20
21
|
# File 'lib/tiun/actor.rb', line 16
def actors
@actors ||= AUTOMAP.keys.map do |const|
require(AUTOMAP[const])
[ const.to_s.downcase, const_get(const) ]
end.to_h
end
|
.for(task, context) ⇒ Object
27
28
29
30
|
# File 'lib/tiun/actor.rb', line 27
def for task, context
for!(task, context)
rescue InvalidActorKindError
end
|
.for!(task, context) ⇒ Object
23
24
25
|
# File 'lib/tiun/actor.rb', line 23
def for! task, context
actors[task.to_s] || raise(InvalidActorKindError)
end
|
12
13
14
|
# File 'lib/tiun/actor.rb', line 12
def kinds
@kinds ||= AUTOMAP.keys.map(&:to_s).map(&:downcase)
end
|