Class: ReceptorController::Client::Directive

Inherits:
Object
  • Object
show all
Defined in:
lib/receptor_controller/client/directive.rb

Direct Known Subclasses

DirectiveBlocking, DirectiveNonBlocking

Instance Attribute Summary collapse

Instance Method Summary collapse

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.            = 
  self.client             = client
  self.log_message_common = log_message_common
  self.name               = name
  self.node_id            = node_id
  self.payload            = payload
end

Instance Attribute Details

#accountObject

Returns the value of attribute account.



5
6
7
# File 'lib/receptor_controller/client/directive.rb', line 5

def 
  @account
end

#clientObject

Returns the value of attribute client.



5
6
7
# File 'lib/receptor_controller/client/directive.rb', line 5

def client
  @client
end

#log_message_commonObject

Returns the value of attribute log_message_common.



5
6
7
# File 'lib/receptor_controller/client/directive.rb', line 5

def log_message_common
  @log_message_common
end

#nameObject

Returns the value of attribute name.



5
6
7
# File 'lib/receptor_controller/client/directive.rb', line 5

def name
  @name
end

#node_idObject

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

#payloadObject

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

Raises:

  • (NotImplementedError)


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_bodyObject



24
25
26
27
28
29
30
31
# File 'lib/receptor_controller/client/directive.rb', line 24

def default_body
  {
    :account   => ,
    :recipient => node_id,
    :payload   => payload,
    :directive => name
  }
end