Class: Batsd::Dash::Connection
- Inherits:
-
Object
- Object
- Batsd::Dash::Connection
- Defined in:
- lib/batsd-dash/connection.rb
Defined Under Namespace
Classes: SocketError
Instance Attribute Summary collapse
-
#socket ⇒ Object
readonly
Returns the value of attribute socket.
Instance Method Summary collapse
- #available ⇒ Object
-
#initialize(host, port) ⇒ Connection
constructor
A new instance of Connection.
- #values(statistic, range) ⇒ Object
Constructor Details
#initialize(host, port) ⇒ Connection
Returns a new instance of Connection.
10 11 12 13 14 15 |
# File 'lib/batsd-dash/connection.rb', line 10 def initialize(host, port) @host = host @port = port connect_socket end |
Instance Attribute Details
#socket ⇒ Object (readonly)
Returns the value of attribute socket.
8 9 10 |
# File 'lib/batsd-dash/connection.rb', line 8 def socket @socket end |
Instance Method Details
#available ⇒ Object
17 18 19 |
# File 'lib/batsd-dash/connection.rb', line 17 def available query 'available' end |
#values(statistic, range) ⇒ Object
21 22 23 |
# File 'lib/batsd-dash/connection.rb', line 21 def values(statistic, range) query "values #{statistic} #{range[0]} #{range[1]}" end |