Files
qmp_client/lib/qmp_client/messages/message.rb
Nick Thomas 51175ddf56 Initial, simple, unit-tested implementation of QMPClient.
This follows the README given earlier, at least in principle, but
doesn't implement the entirety of QMP, by any stretch of the
imagination.

Notable by their absence are error responses, argument validation
(for incoming and outgoing messsages of all types), and any visibility
into qmp_capabilities.

Also missing are integration tests.
2011-11-13 18:36:51 +00:00

22 lines
446 B
Ruby

module QMPClient
module Messages
class Message
# Can we build a Message from the object?
def self.represents?(obj)
obj.is_a?(Hash)
end
def represents?(obj)
self.class.represents?(obj)
end
# Create a new Message.
# @param[Hash] obj source data for the message.
def initialize
raise NotImplementedError.new("Can't instantiate base class")
end
end
end
end