Class: Colloquy::Renderer::FlowPool
- Inherits:
-
Object
- Object
- Colloquy::Renderer::FlowPool
- Defined in:
- lib/colloquy/flow_pool.rb
Class Method Summary collapse
- .add_flow(flow_name, flow) ⇒ Object
- .create_flows(flow_name, flow_class, pool_size, options) ⇒ Object
- .flow_pool ⇒ Object
- .pop_flow(flow_name) ⇒ Object
Class Method Details
.add_flow(flow_name, flow) ⇒ Object
17 18 19 |
# File 'lib/colloquy/flow_pool.rb', line 17 def self.add_flow(flow_name, flow) @flow_pool[flow_name.to_sym] << flow end |
.create_flows(flow_name, flow_class, pool_size, options) ⇒ Object
3 4 5 6 7 |
# File 'lib/colloquy/flow_pool.rb', line 3 def self.create_flows(flow_name, flow_class, pool_size, ) pool_size.times do |i| flow_pool[flow_name.to_sym] << flow_class.constantize.new(flow_name, ) end end |
.flow_pool ⇒ Object
9 10 11 |
# File 'lib/colloquy/flow_pool.rb', line 9 def self.flow_pool @flow_pool ||= Hash.new { |hash, key| hash[key] = [] } end |
.pop_flow(flow_name) ⇒ Object
13 14 15 |
# File 'lib/colloquy/flow_pool.rb', line 13 def self.pop_flow(flow_name) @flow_pool[flow_name.to_sym].pop end |