Class: NSCA::Client
- Inherits:
-
Object
- Object
- NSCA::Client
- Defined in:
- lib/nsca/client.rb
Defined Under Namespace
Classes: Connection
Instance Attribute Summary collapse
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
Instance Method Summary collapse
-
#initialize(hostname = nil, port = nil, password = nil) ⇒ Client
constructor
A new instance of Client.
- #open(&e) ⇒ Object
- #send(*results) ⇒ Object
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
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
90 91 92 |
# File 'lib/nsca/client.rb', line 90 def hostname @hostname end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
90 91 92 |
# File 'lib/nsca/client.rb', line 90 def password @password end |
#port ⇒ Object (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 |