logstash/lib/net/messages/indexevent.rb
Jordan Sissel 434a633013 - hashbind is back! Dynamically generate methods that we would normally
hand-code. This method is as fast as the hand-coded method and with less
  writing.
- Make message registration easier with a simple 'register' function:
  class Foo < Message
    register
  end

  We dynamically generate the message 'type' by the class name.
2009-09-10 09:59:24 +00:00

29 lines
638 B
Ruby

require "lib/net/message"
module LogStash; module Net; module Messages
class IndexEventRequest < RequestMessage
register
def initialize
super
self.metadata = Hash.new
end
hashbind :log_type, "/args/type"
hashbind :log_data, "/args/message"
hashbind :metadata, "/args/metadata"
end # class IndexEventRequest
class IndexEventResponse < ResponseMessage
register
# Message attributes
hashbind :code, "/args/code"
hashbind :error, "/args/error"
def success?
return self.code == 0
end
end # class IndexEventResponse
end; end; end # module LogStash::Net::Messages