Class: NSCA::Client

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

Defined Under Namespace

Classes: Connection

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(hostname = nil, port = nil, password = nil) ⇒ Client

Returns a new instance of Client.



91
92
93
# File 'lib/nsca/client.rb', line 91

def initialize hostname = nil, port = nil, password = nil
	@hostname, @port, @password = hostname, port, password
end

Instance Attribute Details

#hostnameObject (readonly)

Returns the value of attribute hostname.



90
91
92
# File 'lib/nsca/client.rb', line 90

def hostname
  @hostname
end

#passwordObject (readonly)

Returns the value of attribute password.



90
91
92
# File 'lib/nsca/client.rb', line 90

def password
  @password
end

#portObject (readonly)

Returns the value of attribute port.



90
91
92
# File 'lib/nsca/client.rb', line 90

def port
  @port
end

Instance Method Details

#open(&e) ⇒ Object



95
# File 'lib/nsca/client.rb', line 95

def open( &e) Connection.open hostname: @hostname, port: @port, password: @password, &e end

#send(*results) ⇒ Object



96
# File 'lib/nsca/client.rb', line 96

def send( *results) open {|conn| conn.send results } end