Sha256: 34d9587e1d3266df9684225d83f6efc3d5c83b638633f9a67303a1aa948b7294

Contents?: true

Size: 351 Bytes

Versions: 1

Compression:

Stored size: 351 Bytes

Contents

class Localjob
  class Channel
    attr_accessor :queues

    def initialize(queues)
      @queues = [queues].flatten.map { |q| queue_from_name(q) }
    end

    def <<(queue)
      @queues << queue_from_name(queue)
    end

    private
    def queue_from_name(queue)
      queue.instance_of?(Localjob) ? queue : Localjob.new(queue)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
localjob-0.1.1 lib/localjob/channel.rb