Class: TaskHandler
Direct Known Subclasses
Class Method Summary collapse
- .inherited(subclass) ⇒ Object
- .known_handlers ⇒ Object
-
.method_missing(name, *args, &block) ⇒ Object
On the backend, we proxy all class methods like we would on the front-end.
Instance Method Summary collapse
-
#initialize(channel = nil, dispatcher = nil) ⇒ TaskHandler
constructor
A new instance of TaskHandler.
Constructor Details
#initialize(channel = nil, dispatcher = nil) ⇒ TaskHandler
Returns a new instance of TaskHandler.
9 10 11 12 |
# File 'lib/volt/tasks/task_handler.rb', line 9 def initialize(channel=nil, dispatcher=nil) @channel = channel @dispatcher = dispatcher end |
Class Method Details
.inherited(subclass) ⇒ Object
14 15 16 17 |
# File 'lib/volt/tasks/task_handler.rb', line 14 def self.inherited(subclass) @subclasses ||= [] @subclasses << subclass end |
.known_handlers ⇒ Object
19 20 21 |
# File 'lib/volt/tasks/task_handler.rb', line 19 def self.known_handlers @subclasses ||= [] end |
.method_missing(name, *args, &block) ⇒ Object
On the backend, we proxy all class methods like we would on the front-end. This returns promises.
5 6 7 |
# File 'lib/volt/tasks/task_handler.rb', line 5 def self.method_missing(name, *args, &block) $page.tasks.call(self.name, name, *args, &block) end |