Class: Orientdb4r::RestNode
Overview
This class represents a single sever/node in the Distributed Multi-Master Architecture accessible view REST API.
Direct Known Subclasses
Constant Summary collapse
- SESSION_COOKIE_NAME =
Name of cookie that represents a session.
'OSESSIONID'
Instance Attribute Summary collapse
-
#ssl ⇒ Object
readonly
Returns the value of attribute ssl.
-
#user_agent ⇒ Object
HTTP header ‘User-Agent’.
Attributes inherited from Node
Instance Method Summary collapse
-
#initialize(host, port, ssl) ⇒ RestNode
constructor
Constructor.
-
#request(options) ⇒ Object
Sends a HTTP request to the remote server.
-
#url ⇒ Object
:nodoc:.
Methods inherited from Node
Methods included from Utils
#blank?, #compare_versions, #random_string, #verify_and_sanitize_options, #verify_options
Constructor Details
#initialize(host, port, ssl) ⇒ RestNode
Constructor.
17 18 19 20 21 |
# File 'lib/orientdb4r/rest/node.rb', line 17 def initialize(host, port, ssl) super(host, port) raise ArgumentError, 'ssl flag cannot be blank' if blank?(ssl) @ssl = ssl end |
Instance Attribute Details
#ssl ⇒ Object (readonly)
Returns the value of attribute ssl.
11 12 13 |
# File 'lib/orientdb4r/rest/node.rb', line 11 def ssl @ssl end |
#user_agent ⇒ Object
HTTP header ‘User-Agent’
13 14 15 |
# File 'lib/orientdb4r/rest/node.rb', line 13 def user_agent @user_agent end |
Instance Method Details
#request(options) ⇒ Object
Sends a HTTP request to the remote server. Use following if possible:
-
session_id
-
Keep-Alive (if possible)
37 38 39 |
# File 'lib/orientdb4r/rest/node.rb', line 37 def request() raise NotImplementedError, 'this should be overridden by subclass' end |
#url ⇒ Object
:nodoc:
24 25 26 |
# File 'lib/orientdb4r/rest/node.rb', line 24 def url #:nodoc: "http#{'s' if ssl}://#{host}:#{port}" end |