Class: ActiveCypher::Bolt::Messaging::Message

Inherits:
Object
  • Object
show all
Defined in:
lib/active_cypher/bolt/messaging.rb

Overview

Base class — automatically registers subclasses with SIGNATURE Because inheritance hierarchies are the only thing deeper than this protocol.

Direct Known Subclasses

Begin, EmptyMessage, MetadataMessage, Record, Run

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(signature, fields) ⇒ Message

Returns a new instance of Message.



52
53
54
55
# File 'lib/active_cypher/bolt/messaging.rb', line 52

def initialize(signature, fields)
  @signature = signature
  @fields    = fields
end

Instance Attribute Details

#fieldsObject (readonly)

Returns the value of attribute fields.



50
51
52
# File 'lib/active_cypher/bolt/messaging.rb', line 50

def fields
  @fields
end

#signatureObject (readonly)

Returns the value of attribute signature.



50
51
52
# File 'lib/active_cypher/bolt/messaging.rb', line 50

def signature
  @signature
end

Class Method Details

.inherited(subclass) ⇒ Object



64
65
66
67
# File 'lib/active_cypher/bolt/messaging.rb', line 64

def self.inherited(subclass)
  Messaging.register(subclass)
  super
end

Instance Method Details

#==(other) ⇒ Object Also known as: eql?



57
58
59
60
61
# File 'lib/active_cypher/bolt/messaging.rb', line 57

def ==(other)
  other.class == self.class &&
    other.signature == signature &&
    other.fields    == fields
end