Class: Neo4j::Driver::PackStream::Structure

Inherits:
Object
  • Object
show all
Defined in:
lib/neo4j/driver/packstream/structure.rb

Overview

Represents a PackStream Structure with a signature and fields

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#fieldsObject (readonly)

Returns the value of attribute fields.



8
9
10
# File 'lib/neo4j/driver/packstream/structure.rb', line 8

def fields
  @fields
end

#signatureObject (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_sObject



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