Class: Neo4j::Driver::Summary::Notification
- Inherits:
-
Object
- Object
- Neo4j::Driver::Summary::Notification
- Defined in:
- lib/neo4j/driver/summary/notification.rb
Overview
Server-emitted notification (e.g. "this query has a missing index"). Mirrors org.neo4j.driver.summary.Notification.
Defined Under Namespace
Classes: Position
Constant Summary collapse
- KNOWN_SEVERITIES =
Severity mapping matches the Java driver's NotificationSeverity: WARNING/INFORMATION/OFF/UNKNOWN. Anything else stays as nil on severity_level but is preserved verbatim in raw_severity_level.
%w[WARNING INFORMATION OFF UNKNOWN].freeze
- KNOWN_CATEGORIES =
%w[HINT UNRECOGNIZED UNSUPPORTED PERFORMANCE DEPRECATION GENERIC SECURITY TOPOLOGY SCHEMA].freeze
Instance Attribute Summary collapse
-
#category ⇒ Object
readonly
Returns the value of attribute category.
-
#code ⇒ Object
readonly
Returns the value of attribute code.
-
#description ⇒ Object
readonly
Returns the value of attribute description.
-
#position ⇒ Object
readonly
Returns the value of attribute position.
-
#raw_category ⇒ Object
readonly
Returns the value of attribute raw_category.
-
#raw_severity_level ⇒ Object
readonly
Returns the value of attribute raw_severity_level.
-
#severity ⇒ Object
readonly
Returns the value of attribute severity.
-
#severity_level ⇒ Object
readonly
Returns the value of attribute severity_level.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Instance Method Summary collapse
-
#initialize(data) ⇒ Notification
constructor
A new instance of Notification.
Constructor Details
#initialize(data) ⇒ Notification
Returns a new instance of Notification.
19 20 21 22 23 24 25 26 27 28 29 30 |
# File 'lib/neo4j/driver/summary/notification.rb', line 19 def initialize(data) @code = data[:code] @title = data[:title] @description = data[:description] # Old wire format used :severity, newer uses :severityLevel. @raw_severity_level = data[:severityLevel] || data[:severity] @severity_level = KNOWN_SEVERITIES.include?(@raw_severity_level) ? @raw_severity_level : 'UNKNOWN' @severity = @raw_severity_level @raw_category = data[:category] @category = KNOWN_CATEGORIES.include?(@raw_category) ? @raw_category : 'UNKNOWN' @position = data[:position] && Position.new(data[:position]) end |
Instance Attribute Details
#category ⇒ Object (readonly)
Returns the value of attribute category.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def category @category end |
#code ⇒ Object (readonly)
Returns the value of attribute code.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def code @code end |
#description ⇒ Object (readonly)
Returns the value of attribute description.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def description @description end |
#position ⇒ Object (readonly)
Returns the value of attribute position.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def position @position end |
#raw_category ⇒ Object (readonly)
Returns the value of attribute raw_category.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def raw_category @raw_category end |
#raw_severity_level ⇒ Object (readonly)
Returns the value of attribute raw_severity_level.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def raw_severity_level @raw_severity_level end |
#severity ⇒ Object (readonly)
Returns the value of attribute severity.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def severity @severity end |
#severity_level ⇒ Object (readonly)
Returns the value of attribute severity_level.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def severity_level @severity_level end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
9 10 11 |
# File 'lib/neo4j/driver/summary/notification.rb', line 9 def title @title end |