Class: Orientdb4r::Node
- Inherits:
-
Object
- Object
- Orientdb4r::Node
- Includes:
- Utils
- Defined in:
- lib/orientdb4r/node.rb
Overview
This class represents a single sever/node in the Distributed Multi-Master Architecture.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#host ⇒ Object
readonly
they are immutable.
-
#port ⇒ Object
readonly
they are immutable.
-
#session_id ⇒ Object
readonly
Returns the value of attribute session_id.
Instance Method Summary collapse
-
#cleanup ⇒ Object
Cleans up resources used by the node.
-
#initialize(host, port) ⇒ Node
constructor
Constructor.
-
#to_s ⇒ Object
:nodoc:.
-
#url ⇒ Object
Gets URL of the remote node.
Methods included from Utils
#blank?, #compare_versions, #random_string, #verify_and_sanitize_options, #verify_options
Constructor Details
#initialize(host, port) ⇒ Node
Constructor.
14 15 16 17 18 19 |
# File 'lib/orientdb4r/node.rb', line 14 def initialize(host, port) raise ArgumentError, 'host cannot be blank' if blank? host raise ArgumentError, 'port cannot be blank' if blank? port @host = host @port = port end |
Instance Attribute Details
#host ⇒ Object (readonly)
they are immutable
9 10 11 |
# File 'lib/orientdb4r/node.rb', line 9 def host @host end |
#port ⇒ Object (readonly)
they are immutable
9 10 11 |
# File 'lib/orientdb4r/node.rb', line 9 def port @port end |
#session_id ⇒ Object (readonly)
Returns the value of attribute session_id.
10 11 12 |
# File 'lib/orientdb4r/node.rb', line 10 def session_id @session_id end |
Instance Method Details
#cleanup ⇒ Object
Cleans up resources used by the node.
24 25 26 |
# File 'lib/orientdb4r/node.rb', line 24 def cleanup @session_id = nil end |
#to_s ⇒ Object
:nodoc:
36 37 38 |
# File 'lib/orientdb4r/node.rb', line 36 def to_s #:nodoc: "Node(host=#{host},port=#{port})" end |
#url ⇒ Object
Gets URL of the remote node.
31 32 33 |
# File 'lib/orientdb4r/node.rb', line 31 def url raise NotImplementedError, 'this should be overridden by subclass' end |