Skip to content

Instantly share code, notes, and snippets.

@macks
Created April 22, 2011 17:19
Show Gist options
  • Save macks/937135 to your computer and use it in GitHub Desktop.
Save macks/937135 to your computer and use it in GitHub Desktop.
rprotoc session
~$ cat info_t.proto
message Info_t {
required string Category = 1;
required string Value = 2;
}
~$ rprotoc info_t.proto
./info_t.pb.rb writing...
~$ cat test.rb
require 'info_t.pb'
m1 = Info_t.new(:Category => 'x', :Value => 'y')
string = m1.to_s
m2 = Info_t.new.parse_from_string(string)
p m2
~$ ruby test.rb
Category: "x"
Value: "y"
~$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment