Class: OrientdbBinary::Connection
- Inherits:
-
Object
- Object
- OrientdbBinary::Connection
- Defined in:
- lib/orientdb_binary/connection.rb
Instance Attribute Summary collapse
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#socket ⇒ Object
Returns the value of attribute socket.
Instance Method Summary collapse
- #close ⇒ Object
-
#initialize(options) ⇒ Connection
constructor
A new instance of Connection.
Constructor Details
#initialize(options) ⇒ Connection
Returns a new instance of Connection.
6 7 8 9 |
# File 'lib/orientdb_binary/connection.rb', line 6 def initialize() @socket = TCPSocket.open([:host], [:port]) @protocol = BinData::Int16be.read(socket) end |
Instance Attribute Details
#protocol ⇒ Object
Returns the value of attribute protocol.
4 5 6 |
# File 'lib/orientdb_binary/connection.rb', line 4 def protocol @protocol end |
#socket ⇒ Object
Returns the value of attribute socket.
4 5 6 |
# File 'lib/orientdb_binary/connection.rb', line 4 def socket @socket end |
Instance Method Details
#close ⇒ Object
11 12 13 14 |
# File 'lib/orientdb_binary/connection.rb', line 11 def close socket.close @protocol = nil end |