Class: Daemon::MasterProcess::Message
- Inherits:
-
Object
- Object
- Daemon::MasterProcess::Message
- Defined in:
- lib/onapp/engine/master_process/message.rb
Instance Attribute Summary (collapse)
-
- (Object) command
readonly
Returns the value of attribute command.
-
- (Object) data
readonly
Returns the value of attribute data.
-
- (Object) destination
readonly
Returns the value of attribute destination.
-
- (Object) raw
(also: #to_s)
readonly
Returns the value of attribute raw.
Instance Method Summary (collapse)
- - (Boolean) current_node?
-
- (Message) initialize(raw)
constructor
A new instance of Message.
Constructor Details
- (Message) initialize(raw)
Returns a new instance of Message
6 7 8 9 10 11 |
# File 'lib/onapp/engine/master_process/message.rb', line 6 def initialize(raw) @raw = raw @data = parse(@raw) || {} @destination = @data.delete('destination') @command = @data.fetch('payload', {})['cmd'] end |
Instance Attribute Details
- (Object) command (readonly)
Returns the value of attribute command
4 5 6 |
# File 'lib/onapp/engine/master_process/message.rb', line 4 def command @command end |
- (Object) data (readonly)
Returns the value of attribute data
4 5 6 |
# File 'lib/onapp/engine/master_process/message.rb', line 4 def data @data end |
- (Object) destination (readonly)
Returns the value of attribute destination
4 5 6 |
# File 'lib/onapp/engine/master_process/message.rb', line 4 def destination @destination end |
- (Object) raw (readonly) Also known as: to_s
Returns the value of attribute raw
4 5 6 |
# File 'lib/onapp/engine/master_process/message.rb', line 4 def raw @raw end |
Instance Method Details
- (Boolean) current_node?
13 14 15 16 |
# File 'lib/onapp/engine/master_process/message.rb', line 13 def current_node? [::Availability::ALL_NODES, Availability::ClusteringService.current_node_ip] .include?(destination) end |