Class: Synack::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/synack/client.rb

Constant Summary collapse

DEFAULT_OPTIONS =
{
  host: 'localhost',
  port: 11113
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Instance methods =============================================================================



17
18
19
20
21
22
23
24
# File 'lib/synack/client.rb', line 17

def initialize(options = {})
  options = DEFAULT_OPTIONS.merge(options)

  @host = options[:host]
  @port = options[:port]

  @socket = DRbObject.new(nil, "druby://#{@host}:#{@port}")
end

Instance Attribute Details

#hostObject (readonly)

Returns the value of attribute host.



13
14
15
# File 'lib/synack/client.rb', line 13

def host
  @host
end

#portObject (readonly)

Returns the value of attribute port.



13
14
15
# File 'lib/synack/client.rb', line 13

def port
  @port
end

#socketObject (readonly)

Returns the value of attribute socket.



13
14
15
# File 'lib/synack/client.rb', line 13

def socket
  @socket
end

Instance Method Details

#say(message) ⇒ Object



26
27
28
# File 'lib/synack/client.rb', line 26

def say(message)
  @socket.say(message)
end