Class: RosettaQueue::Destinations
- Inherits:
-
Object
- Object
- RosettaQueue::Destinations
- Defined in:
- lib/rosetta_queue/destinations.rb
Class Method Summary collapse
- .clear ⇒ Object
- .define {|_self| ... } ⇒ Object
- .lookup(dest_name) ⇒ Object
- .map(key, dest) ⇒ Object
- .queue_names ⇒ Object
Class Method Details
.clear ⇒ Object
13 14 15 |
# File 'lib/rosetta_queue/destinations.rb', line 13 def clear @dest.clear end |
.define {|_self| ... } ⇒ Object
9 10 11 |
# File 'lib/rosetta_queue/destinations.rb', line 9 def define yield self end |
.lookup(dest_name) ⇒ Object
17 18 19 20 21 |
# File 'lib/rosetta_queue/destinations.rb', line 17 def lookup(dest_name) mapping = @dest[dest_name.to_sym] raise "No destination mapping for '#{dest_name}' has been defined!" unless mapping return mapping end |
.map(key, dest) ⇒ Object
23 24 25 |
# File 'lib/rosetta_queue/destinations.rb', line 23 def map(key, dest) @dest[key] = dest end |
.queue_names ⇒ Object
27 28 29 |
# File 'lib/rosetta_queue/destinations.rb', line 27 def queue_names @dest.values end |