Class: OrientdbBinary::OrientdbBase
- Inherits:
-
Object
- Object
- OrientdbBinary::OrientdbBase
- Defined in:
- lib/orientdb_binary/base.rb
Instance Attribute Summary collapse
-
#protocol ⇒ Object
Returns the value of attribute protocol.
-
#session ⇒ Object
Returns the value of attribute session.
-
#socket ⇒ Object
Returns the value of attribute socket.
Instance Method Summary collapse
- #close ⇒ Object
- #connected? ⇒ Boolean
- #disconnect ⇒ Object
-
#initialize(options) ⇒ OrientdbBase
constructor
A new instance of OrientdbBase.
Constructor Details
#initialize(options) ⇒ OrientdbBase
Returns a new instance of OrientdbBase.
5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/orientdb_binary/base.rb', line 5 def initialize() defaults = { host: 'localhost', port: 2424 } = defaults.merge() @server_connection = OrientdbBinary::Connection.new() @socket = @server_connection.socket @connected = false @session = OrientdbBinary::OperationTypes::NEW_SESSION end |
Instance Attribute Details
#protocol ⇒ Object
Returns the value of attribute protocol.
3 4 5 |
# File 'lib/orientdb_binary/base.rb', line 3 def protocol @protocol end |
#session ⇒ Object
Returns the value of attribute session.
3 4 5 |
# File 'lib/orientdb_binary/base.rb', line 3 def session @session end |
#socket ⇒ Object
Returns the value of attribute socket.
3 4 5 |
# File 'lib/orientdb_binary/base.rb', line 3 def socket @socket end |
Instance Method Details
#close ⇒ Object
28 29 30 31 |
# File 'lib/orientdb_binary/base.rb', line 28 def close @session = OrientdbBinary::OperationTypes::NEW_SESSION @connected = false end |
#connected? ⇒ Boolean
19 20 21 |
# File 'lib/orientdb_binary/base.rb', line 19 def connected? @connected end |
#disconnect ⇒ Object
23 24 25 26 |
# File 'lib/orientdb_binary/base.rb', line 23 def disconnect close @server_connection.close() end |