Created
April 22, 2011 17:19
-
-
Save macks/937135 to your computer and use it in GitHub Desktop.
rprotoc session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
~$ 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