Class: Dor::Event::Client

Inherits:
Object
  • Object
show all
Includes:
Singleton
Defined in:
lib/dor/event/client.rb,
lib/dor/event/client/version.rb,
lib/dor/event/client/create_operation.rb,
lib/dor/event/client/rabbit_channel_factory.rb

Overview

Client for event services.

Defined Under Namespace

Classes: CreateOperation, Error, RabbitChannelFactory

Constant Summary collapse

VERSION =
'1.0.0'

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#channel=(value) ⇒ Object

Sets the attribute channel

Parameters:

  • value

    the value to set the attribute channel to.



42
43
44
# File 'lib/dor/event/client.rb', line 42

def channel=(value)
  @channel = value
end

#hostname=(value) ⇒ Object

Sets the attribute hostname

Parameters:

  • value

    the value to set the attribute hostname to.



42
43
44
# File 'lib/dor/event/client.rb', line 42

def hostname=(value)
  @hostname = value
end

#password=(value) ⇒ Object

Sets the attribute password

Parameters:

  • value

    the value to set the attribute password to.



42
43
44
# File 'lib/dor/event/client.rb', line 42

def password=(value)
  @password = value
end

#username=(value) ⇒ Object

Sets the attribute username

Parameters:

  • value

    the value to set the attribute username to.



42
43
44
# File 'lib/dor/event/client.rb', line 42

def username=(value)
  @username = value
end

#vhost=(value) ⇒ Object

Sets the attribute vhost

Parameters:

  • value

    the value to set the attribute vhost to.



42
43
44
# File 'lib/dor/event/client.rb', line 42

def vhost=(value)
  @vhost = value
end

Class Method Details

.configure(hostname:, vhost:, username:, password:) ⇒ Object



27
28
29
30
31
32
33
34
35
36
37
# File 'lib/dor/event/client.rb', line 27

def configure(hostname:, vhost:, username:, password:)
  instance.hostname = hostname
  instance.vhost = vhost
  instance.username = username
  instance.password = password

  # Force channel to be re-established when `.configure` is called
  instance.channel = nil

  self
end