Class: Thronglets::Registry
- Inherits:
-
Object
- Object
- Thronglets::Registry
- Defined in:
- lib/thronglets/registry.rb
Instance Attribute Summary collapse
-
#worker ⇒ Object
readonly
Returns the value of attribute worker.
Instance Method Summary collapse
-
#initialize(worker) ⇒ Registry
constructor
A new instance of Registry.
- #load! ⇒ Object
Constructor Details
#initialize(worker) ⇒ Registry
Returns a new instance of Registry.
6 7 8 |
# File 'lib/thronglets/registry.rb', line 6 def initialize(worker) @worker = worker end |
Instance Attribute Details
#worker ⇒ Object (readonly)
Returns the value of attribute worker.
4 5 6 |
# File 'lib/thronglets/registry.rb', line 4 def worker @worker end |
Instance Method Details
#load! ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/thronglets/registry.rb', line 10 def load! list_classes_in_dir("app/activities").each do |activity| if can_register_class?(activity) puts format("Registered: %s", activity) worker.register_activity(activity) end end list_classes_in_dir("app/workflows").each do |workflow| if can_register_class?(workflow) puts format("Registered: %s", workflow) worker.register_workflow(workflow) end end end |