Class: Mylk::Base
- Inherits:
-
Object
- Object
- Mylk::Base
- Defined in:
- lib/mylk/base.rb
Overview
Base class for SurrealDB clients
Instance Attribute Summary collapse
-
#database ⇒ Object
Returns the value of attribute database.
-
#namespace ⇒ Object
Returns the value of attribute namespace.
-
#password ⇒ Object
Returns the value of attribute password.
-
#uri ⇒ Object
Returns the value of attribute uri.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
- #connect ⇒ Object
- #connected? ⇒ Boolean
- #disconnect ⇒ Object
- #disconnected? ⇒ Boolean
-
#initialize(uri) ⇒ Base
constructor
Parameters: uri: String The URI of the SurrealDB server Example: “user:password@localhost:8080/namespace/database”.
Constructor Details
#initialize(uri) ⇒ Base
Parameters:
uri: String
The URI of the SurrealDB server
Example: "http://user:password@localhost:8080/namespace/database"
12 13 14 |
# File 'lib/mylk/base.rb', line 12 def initialize(uri) parse_connection_params(uri) end |
Instance Attribute Details
#database ⇒ Object
Returns the value of attribute database.
6 7 8 |
# File 'lib/mylk/base.rb', line 6 def database @database end |
#namespace ⇒ Object
Returns the value of attribute namespace.
6 7 8 |
# File 'lib/mylk/base.rb', line 6 def namespace @namespace end |
#password ⇒ Object
Returns the value of attribute password.
6 7 8 |
# File 'lib/mylk/base.rb', line 6 def password @password end |
#uri ⇒ Object
Returns the value of attribute uri.
6 7 8 |
# File 'lib/mylk/base.rb', line 6 def uri @uri end |
#username ⇒ Object
Returns the value of attribute username.
6 7 8 |
# File 'lib/mylk/base.rb', line 6 def username @username end |
Instance Method Details
#connect ⇒ Object
16 17 18 |
# File 'lib/mylk/base.rb', line 16 def connect raise NotImplementedError end |
#connected? ⇒ Boolean
24 25 26 |
# File 'lib/mylk/base.rb', line 24 def connected? !!@connected end |
#disconnect ⇒ Object
20 21 22 |
# File 'lib/mylk/base.rb', line 20 def disconnect raise NotImplementedError end |
#disconnected? ⇒ Boolean
28 29 30 |
# File 'lib/mylk/base.rb', line 28 def disconnected? !connected? end |