Class: Cinc::Client
- Inherits:
-
Object
- Object
- Cinc::Client
- Defined in:
- lib/cinc/client.rb
Defined Under Namespace
Classes: Command
Instance Method Summary collapse
- #connect ⇒ Object
- #get_airbases ⇒ Object
-
#initialize(host: 'localhost', port: 9001) ⇒ Client
constructor
A new instance of Client.
Constructor Details
#initialize(host: 'localhost', port: 9001) ⇒ Client
Returns a new instance of Client.
7 8 9 10 |
# File 'lib/cinc/client.rb', line 7 def initialize(host: 'localhost', port: 9001) @host = host @port = port end |
Instance Method Details
#connect ⇒ Object
12 13 14 15 16 |
# File 'lib/cinc/client.rb', line 12 def connect @socket = Socket.tcp(@host, @port, connect_timeout: 10) rescue StandardError => e raise ConnectionError.new(e.) end |