Module: Serf::Message
- Extended by:
- ActiveSupport::Concern
- Defined in:
- lib/serf/message.rb
Overview
A module to represent a message that we’re transporting over the wire. This is mainly for commands and events in ED-SOA. Optional, but useful for validations, etc.
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#kind ⇒ Object
20 21 22 |
# File 'lib/serf/message.rb', line 20 def kind self.class.kind end |
#to_hash ⇒ Object
24 25 26 |
# File 'lib/serf/message.rb', line 24 def to_hash attributes.merge kind: kind end |
#to_json(*args) ⇒ Object
32 33 34 |
# File 'lib/serf/message.rb', line 32 def to_json(*args) to_hash.to_json *args end |
#to_msgpack ⇒ Object
28 29 30 |
# File 'lib/serf/message.rb', line 28 def to_msgpack to_hash.to_msgpack end |