Class: ReceptorController::Client::Directive
- Inherits:
-
Object
- Object
- ReceptorController::Client::Directive
- Defined in:
- lib/receptor_controller/client/directive.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#client ⇒ Object
Returns the value of attribute client.
-
#log_message_common ⇒ Object
Returns the value of attribute log_message_common.
-
#name ⇒ Object
Returns the value of attribute name.
-
#node_id ⇒ Object
Returns the value of attribute node_id.
-
#payload ⇒ Object
Returns the value of attribute payload.
Instance Method Summary collapse
- #call(_body = default_body) ⇒ Object
- #default_body ⇒ Object
-
#initialize(name:, account:, node_id:, payload:, client:, log_message_common: nil) ⇒ Directive
constructor
A new instance of Directive.
Constructor Details
#initialize(name:, account:, node_id:, payload:, client:, log_message_common: nil) ⇒ Directive
Returns a new instance of Directive.
11 12 13 14 15 16 17 18 |
# File 'lib/receptor_controller/client/directive.rb', line 11 def initialize(name:, account:, node_id:, payload:, client:, log_message_common: nil) self.account = account self.client = client self. = self.name = name self.node_id = node_id self.payload = payload end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def account @account end |
#client ⇒ Object
Returns the value of attribute client.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def client @client end |
#log_message_common ⇒ Object
Returns the value of attribute log_message_common.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def @log_message_common end |
#name ⇒ Object
Returns the value of attribute name.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def name @name end |
#node_id ⇒ Object
Returns the value of attribute node_id.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def node_id @node_id end |
#payload ⇒ Object
Returns the value of attribute payload.
5 6 7 |
# File 'lib/receptor_controller/client/directive.rb', line 5 def payload @payload end |
Instance Method Details
#call(_body = default_body) ⇒ Object
20 21 22 |
# File 'lib/receptor_controller/client/directive.rb', line 20 def call(_body = default_body) raise NotImplementedError, "#{__method__} must be implemented in a subclass" end |
#default_body ⇒ Object
24 25 26 27 28 29 30 31 |
# File 'lib/receptor_controller/client/directive.rb', line 24 def default_body { :account => account, :recipient => node_id, :payload => payload, :directive => name } end |