Class: RosettaQueue::Destinations

Inherits:
Object
  • Object
show all
Defined in:
lib/rosetta_queue/destinations.rb

Class Method Summary collapse

Class Method Details

.clearObject



13
14
15
# File 'lib/rosetta_queue/destinations.rb', line 13

def clear
  @dest.clear
end

.define {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



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_namesObject



27
28
29
# File 'lib/rosetta_queue/destinations.rb', line 27

def queue_names
  @dest.values
end