Class: RosettaQueue::Adapter
- Inherits:
-
Object
- Object
- RosettaQueue::Adapter
- Defined in:
- lib/rosetta_queue/adapter.rb
Class Attribute Summary collapse
-
.host ⇒ Object
writeonly
Sets the attribute host.
-
.password ⇒ Object
writeonly
Sets the attribute password.
-
.port ⇒ Object
writeonly
Sets the attribute port.
-
.user ⇒ Object
writeonly
Sets the attribute user.
Class Method Summary collapse
Class Attribute Details
.host=(value) ⇒ Object (writeonly)
Sets the attribute host
7 8 9 |
# File 'lib/rosetta_queue/adapter.rb', line 7 def host=(value) @host = value end |
.password=(value) ⇒ Object (writeonly)
Sets the attribute password
7 8 9 |
# File 'lib/rosetta_queue/adapter.rb', line 7 def password=(value) @password = value end |
.port=(value) ⇒ Object (writeonly)
Sets the attribute port
7 8 9 |
# File 'lib/rosetta_queue/adapter.rb', line 7 def port=(value) @port = value end |
.user=(value) ⇒ Object (writeonly)
Sets the attribute user
7 8 9 |
# File 'lib/rosetta_queue/adapter.rb', line 7 def user=(value) @user = value end |
Class Method Details
.define {|_self| ... } ⇒ Object
9 10 11 |
# File 'lib/rosetta_queue/adapter.rb', line 9 def define yield self end |
.instance ⇒ Object
26 27 28 29 |
# File 'lib/rosetta_queue/adapter.rb', line 26 def instance raise AdapterException, "Adapter type was never defined!" unless @adapter_class @adapter_class.new(@user, @password, @host, @port) end |
.reset ⇒ Object
13 14 15 |
# File 'lib/rosetta_queue/adapter.rb', line 13 def reset @user, @password, @host, @port, @adapter_class = nil, nil, nil, nil, nil end |
.type=(adapter_prefix) ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/rosetta_queue/adapter.rb', line 17 def type=(adapter_prefix) begin require "rosetta_queue/adapters/#{adapter_prefix}" rescue LoadError raise AdapterException, "Adapter type '#{adapter_prefix}' does not match existing adapters!" end @adapter_class = RosettaQueue::Gateway.const_get("#{adapter_prefix.to_s.classify}Adapter") end |