Class: Cuboid::RPC::Client::Base
- Defined in:
- lib/cuboid/rpc/client/base.rb
Overview
Instance Attribute Summary collapse
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #address ⇒ Object
-
#initialize(url, token = nil, options = nil) ⇒ Base
constructor
A new instance of Base.
- #port ⇒ Object
Constructor Details
#initialize(url, token = nil, options = nil) ⇒ Base
Returns a new instance of Base.
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
# File 'lib/cuboid/rpc/client/base.rb', line 22 def initialize( url, token = nil, = nil ) @url = url socket, host, port = nil if url.include? ':' host, port = url.split( ':' ) else socket = url end @address = host @port = port # If given nil use the global defaults. ||= Options.rpc. super( .merge( serializer: Serializer, host: host, port: port.to_i, socket: socket, token: token )) end |
Instance Attribute Details
#url ⇒ Object (readonly)
Returns the value of attribute url.
10 11 12 |
# File 'lib/cuboid/rpc/client/base.rb', line 10 def url @url end |