Class: Synack::Client
- Inherits:
-
Object
- Object
- Synack::Client
- Defined in:
- lib/synack/client.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ host: 'localhost', port: 11113 }
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Client
constructor
Instance methods =============================================================================.
- #say(message) ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Client
Instance methods =============================================================================
17 18 19 20 21 22 23 24 |
# File 'lib/synack/client.rb', line 17 def initialize( = {}) = DEFAULT_OPTIONS.merge() @host = [:host] @port = [:port] @socket = DRbObject.new(nil, "druby://#{@host}:#{@port}") end |
Instance Attribute Details
#host ⇒ Object (readonly)
Returns the value of attribute host.
13 14 15 |
# File 'lib/synack/client.rb', line 13 def host @host end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
13 14 15 |
# File 'lib/synack/client.rb', line 13 def port @port end |
#socket ⇒ Object (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() @socket.say() end |