Adds symbols to access the fields in Status struct
diff --git a/src/ruby/ext/grpc/rb_grpc.c b/src/ruby/ext/grpc/rb_grpc.c
index 400efd0..eeee913 100644
--- a/src/ruby/ext/grpc/rb_grpc.c
+++ b/src/ruby/ext/grpc/rb_grpc.c
@@ -195,7 +195,7 @@
/* id_to_s is the to_s method found on various ruby objects. */
static ID id_to_s;
-/* Converts `a wrapped time constant to a standard time. */
+/* Converts a wrapped time constant to a standard time. */
VALUE grpc_rb_time_val_to_time(VALUE self) {
gpr_timespec *time_const = NULL;
Data_Get_Struct(self, gpr_timespec, time_const);
@@ -257,8 +257,11 @@
rb_mGRPC = rb_define_module("GRPC");
rb_mGrpcCore = rb_define_module_under(rb_mGRPC, "Core");
rb_sNewServerRpc = rb_struct_define("NewServerRpc", "method", "host",
- "deadline", "metadata", NULL);
+ "deadline", "metadata", "call", NULL);
rb_sStatus = rb_struct_define("Status", "code", "details", "metadata", NULL);
+ sym_code = ID2SYM(rb_intern("code"));
+ sym_details = ID2SYM(rb_intern("details"));
+ sym_metadata = ID2SYM(rb_intern("metadata"));
Init_grpc_byte_buffer();
Init_grpc_event();
diff --git a/src/ruby/ext/grpc/rb_grpc.h b/src/ruby/ext/grpc/rb_grpc.h
index 851f5ee..4ff9b7f 100644
--- a/src/ruby/ext/grpc/rb_grpc.h
+++ b/src/ruby/ext/grpc/rb_grpc.h
@@ -50,6 +50,15 @@
/* rb_sStruct is the struct that holds status details. */
extern VALUE rb_sStatus;
+/* sym_code is the symbol for the code attribute of rb_sStatus. */
+VALUE sym_code;
+
+/* sym_details is the symbol for the details attribute of rb_sStatus. */
+VALUE sym_details;
+
+/* sym_metadata is the symbol for the metadata attribute of rb_sStatus. */
+VALUE sym_metadata;
+
/* GC_NOT_MARKED is used in calls to Data_Wrap_Struct to indicate that the
wrapped struct does not need to participate in ruby gc. */
extern const RUBY_DATA_FUNC GC_NOT_MARKED;