Class: RBKubeMQ::Client
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#tls ⇒ Object
readonly
Returns the value of attribute tls.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#ws ⇒ Object
readonly
Returns the value of attribute ws.
Instance Method Summary collapse
-
#initialize(host:, port: "9090", tls: false) ⇒ Client
constructor
A new instance of Client.
- #sender(*args) ⇒ Object
- #streamer(*args) ⇒ Object
- #subscriber(*args) ⇒ Object
Methods included from Check
Constructor Details
#initialize(host:, port: "9090", tls: false) ⇒ Client
Returns a new instance of Client.
5 6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/client.rb', line 5 def initialize(host:, port: "9090", tls: false) @host = host @port = port is_class?(tls, [FalseClass, TrueClass], "tls") @tls = tls @uri = "http" @uri += "s" if @tls @uri += "://#{host}:#{port}" @ws = "ws" @ws += "s" if @tls @ws += "://#{host}:#{port}" end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
18 19 20 |
# File 'lib/client.rb', line 18 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
18 19 20 |
# File 'lib/client.rb', line 18 def port @port end |
#tls ⇒ Object (readonly)
Returns the value of attribute tls.
18 19 20 |
# File 'lib/client.rb', line 18 def tls @tls end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
18 19 20 |
# File 'lib/client.rb', line 18 def uri @uri end |
#ws ⇒ Object (readonly)
Returns the value of attribute ws.
18 19 20 |
# File 'lib/client.rb', line 18 def ws @ws end |
Instance Method Details
#sender(*args) ⇒ Object
20 21 22 23 24 |
# File 'lib/client.rb', line 20 def sender(*args) args[0] ||= {} args[0][:client] = self if args[0].is_a?(Hash) RBKubeMQ::Sender.new(*args) end |
#streamer(*args) ⇒ Object
26 27 28 29 30 |
# File 'lib/client.rb', line 26 def streamer(*args) args[0] ||= {} args[0][:client] = self if args[0].is_a?(Hash) RBKubeMQ::Streamer.new(*args) end |
#subscriber(*args) ⇒ Object
32 33 34 35 36 |
# File 'lib/client.rb', line 32 def subscriber(*args) args[0] ||= {} args[0][:client] = self if args[0].is_a?(Hash) RBKubeMQ::Subscriber.new(*args) end |