Class: Beetle::Base

Inherits:
Object
  • Object
show all
Includes:
Logging
Defined in:
lib/beetle/base.rb

Overview

Abstract base class shared by Publisher and Subscriber

Direct Known Subclasses

Publisher, Subscriber

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from Logging

#logger

Constructor Details

#initialize(client, options = {}) ⇒ Base

:nodoc:



10
11
12
13
14
15
16
17
# File 'lib/beetle/base.rb', line 10

def initialize(client, options = {}) #:nodoc:
  @options = options
  @client = client
  @servers = @client.servers.clone
  @server = @servers[rand @servers.size]
  @exchanges = {}
  @queues = {}
end

Instance Attribute Details

#optionsObject

:nodoc:



8
9
10
# File 'lib/beetle/base.rb', line 8

def options
  @options
end

#serverObject

:nodoc:



8
9
10
# File 'lib/beetle/base.rb', line 8

def server
  @server
end

#serversObject

:nodoc:



8
9
10
# File 'lib/beetle/base.rb', line 8

def servers
  @servers
end