Class: Neo4j::Driver::Summary::ServerInfo
- Inherits:
-
Object
- Object
- Neo4j::Driver::Summary::ServerInfo
- Defined in:
- lib/neo4j/driver/summary/server_info.rb
Overview
Server metadata reported in the SUCCESS response.
Instance Attribute Summary collapse
-
#address ⇒ Object
readonly
Returns the value of attribute address.
-
#agent ⇒ Object
readonly
Returns the value of attribute agent.
-
#protocol_version ⇒ Object
readonly
Returns the value of attribute protocol_version.
Instance Method Summary collapse
-
#initialize(server_data = nil, address: nil, agent: nil, protocol_version: nil) ⇒ ServerInfo
constructor
A new instance of ServerInfo.
- #to_s ⇒ Object
Constructor Details
#initialize(server_data = nil, address: nil, agent: nil, protocol_version: nil) ⇒ ServerInfo
Returns a new instance of ServerInfo.
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
# File 'lib/neo4j/driver/summary/server_info.rb', line 10 def initialize(server_data = nil, address: nil, agent: nil, protocol_version: nil) case server_data when String @agent = server_data @address = address @protocol_version = protocol_version when Hash @address = server_data[:address] || address @agent = server_data[:agent] || agent @protocol_version = server_data[:protocol_version] || protocol_version else @address = address @agent = agent @protocol_version = protocol_version end end |
Instance Attribute Details
#address ⇒ Object (readonly)
Returns the value of attribute address.
8 9 10 |
# File 'lib/neo4j/driver/summary/server_info.rb', line 8 def address @address end |
#agent ⇒ Object (readonly)
Returns the value of attribute agent.
8 9 10 |
# File 'lib/neo4j/driver/summary/server_info.rb', line 8 def agent @agent end |
#protocol_version ⇒ Object (readonly)
Returns the value of attribute protocol_version.
8 9 10 |
# File 'lib/neo4j/driver/summary/server_info.rb', line 8 def protocol_version @protocol_version end |
Instance Method Details
#to_s ⇒ Object
27 28 29 |
# File 'lib/neo4j/driver/summary/server_info.rb', line 27 def to_s @agent || 'Unknown' end |