Class: Neo4j::Driver::PackStream::Structure
- Inherits:
-
Object
- Object
- Neo4j::Driver::PackStream::Structure
- Defined in:
- lib/neo4j/driver/packstream/structure.rb
Overview
Represents a PackStream Structure with a signature and fields
Instance Attribute Summary collapse
-
#fields ⇒ Object
readonly
Returns the value of attribute fields.
-
#signature ⇒ Object
readonly
Returns the value of attribute signature.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(signature, fields = []) ⇒ Structure
constructor
A new instance of Structure.
- #to_s ⇒ Object
Constructor Details
#initialize(signature, fields = []) ⇒ Structure
Returns a new instance of Structure.
10 11 12 13 |
# File 'lib/neo4j/driver/packstream/structure.rb', line 10 def initialize(signature, fields = []) @signature = signature @fields = fields end |
Instance Attribute Details
#fields ⇒ Object (readonly)
Returns the value of attribute fields.
8 9 10 |
# File 'lib/neo4j/driver/packstream/structure.rb', line 8 def fields @fields end |
#signature ⇒ Object (readonly)
Returns the value of attribute signature.
8 9 10 |
# File 'lib/neo4j/driver/packstream/structure.rb', line 8 def signature @signature end |
Instance Method Details
#==(other) ⇒ Object
15 16 17 18 19 |
# File 'lib/neo4j/driver/packstream/structure.rb', line 15 def ==(other) other.is_a?(Structure) && other.signature == @signature && other.fields == @fields end |
#to_s ⇒ Object
21 22 23 |
# File 'lib/neo4j/driver/packstream/structure.rb', line 21 def to_s "Structure(0x#{@signature.to_s(16).upcase}, #{@fields.inspect})" end |