Module: CarrotRpc::ClientServer
Overview
Common functionality for Client and Server.
Instance Method Summary collapse
- #queue_name(*args) ⇒ Object
- #queue_options(*args) ⇒ Object
- #test_queue_name(name, append_name = false) ⇒ Object
Instance Method Details
#queue_name(new_name) ⇒ String #queue_name ⇒ String
15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/carrot_rpc/client_server.rb', line 15 def queue_name(*args) if args.length == 0 @queue_name elsif args.length == 1 @queue_name = args[0] else fail ArgumentError, "queue_name(new_name) :: new_name or queue_name() :: " \ "current_name are the only ways to call queue_name" end end |
#queue_options(options) ⇒ Object #queue_options ⇒ Hash
37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/carrot_rpc/client_server.rb', line 37 def (*args) if args.length == 0 @queue_options || {} elsif args.length == 1 @queue_options = args[0] else fail ArgumentError, "queue_options(options) :: options or queue_options() :: " \ "current_options are the only ways to call queue_options" end end |
#test_queue_name(name, append_name = false) ⇒ Object
49 50 51 52 53 54 55 56 |
# File 'lib/carrot_rpc/client_server.rb', line 49 def test_queue_name(name, append_name = false) return name unless append_name if name "#{name}_test" else fail CarrotRpc::Exception::InvalidQueueName end end |