Class: AhoyCaptain::FunnelCollection
- Inherits:
-
Object
- Object
- AhoyCaptain::FunnelCollection
- Includes:
- Enumerable
- Defined in:
- lib/ahoy_captain/funnels.rb
Instance Method Summary collapse
- #[](value) ⇒ Object
- #each(&block) ⇒ Object
-
#initialize ⇒ FunnelCollection
constructor
A new instance of FunnelCollection.
- #register(funnel) ⇒ Object
Constructor Details
#initialize ⇒ FunnelCollection
Returns a new instance of FunnelCollection.
28 29 30 |
# File 'lib/ahoy_captain/funnels.rb', line 28 def initialize @funnels = {} end |
Instance Method Details
#[](value) ⇒ Object
40 41 42 |
# File 'lib/ahoy_captain/funnels.rb', line 40 def [](value) @funnels[value.to_sym] end |
#each(&block) ⇒ Object
36 37 38 |
# File 'lib/ahoy_captain/funnels.rb', line 36 def each(&block) @funnels.each(&block) end |
#register(funnel) ⇒ Object
32 33 34 |
# File 'lib/ahoy_captain/funnels.rb', line 32 def register(funnel) @funnels[funnel.id] = funnel end |