File: message.rb

package info (click to toggle)
ruby-riemann-client 0.2.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 148 kB
  • sloc: ruby: 730; makefile: 2
file content (17 lines) | stat: -rw-r--r-- 360 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
module Riemann
  class Message
    include Beefcake::Message
    
    optional :ok, :bool, 2
    optional :error, :string, 3
    repeated :states, State, 4
    optional :query, Query, 5
    repeated :events, Event, 6

    def encode_with_length
      buffer = ''
      encoded = encode buffer
      "#{[encoded.length].pack('N')}#{encoded}"
    end
  end 
end