Class: MQRPC::ResponseMessage

Inherits:
Message
  • Object
show all
Defined in:
lib/mqrpc/message.rb

Overview

class RequestMessage

Direct Known Subclasses

Messages::PingResponse

Instance Method Summary collapse

Methods inherited from Message

#age, #buffer?, #generate_id!, inherited, new_from_data, #to_json, #want_buffer

Methods included from BindToHash

#argument, #header

Constructor Details

#initialize(source_request = nil) ⇒ ResponseMessage

Returns a new instance of ResponseMessage.



121
122
123
124
125
126
127
128
129
# File 'lib/mqrpc/message.rb', line 121

def initialize(source_request=nil)
  super()

  # Copy the request id if we are given a source_request
  if source_request.is_a?(RequestMessage)
    self.in_reply_to = source_request.id
  end
  self.args = Hash.new
end

Instance Method Details

#success?Boolean

Report the success of the request this response is for. Should be implemented by subclasses.

Returns:

  • (Boolean)

Raises:

  • (NotImplementedError)


133
134
135
# File 'lib/mqrpc/message.rb', line 133

def success?
  raise NotImplementedError
end