Class: OtStatus::Query
- Inherits:
-
Object
- Object
- OtStatus::Query
- Defined in:
- lib/otstatus.rb
Defined Under Namespace
Classes: Connection
Instance Attribute Summary collapse
-
#response ⇒ Object
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(connect_timeout = 5, inactivity_timeout = 10) ⇒ Query
constructor
A new instance of Query.
- #run(hostname, port) ⇒ Object
Constructor Details
#initialize(connect_timeout = 5, inactivity_timeout = 10) ⇒ Query
Returns a new instance of Query.
11 12 13 14 15 |
# File 'lib/otstatus.rb', line 11 def initialize connect_timeout=5, inactivity_timeout=10 @response = nil @connect_timeout = connect_timeout @inactivity_timeout = inactivity_timeout end |
Instance Attribute Details
#response ⇒ Object
Returns the value of attribute response.
9 10 11 |
# File 'lib/otstatus.rb', line 9 def response @response end |
Instance Method Details
#run(hostname, port) ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/otstatus.rb', line 17 def run hostname, port EventMachine.run { EventMachine::connect hostname, port, Connection, self, @connect_timeout, @inactivity_timeout } parse @response end |