THRIFT-245. rb: FIELDS constant should contain name of enumerated type for enum fields
authorBryan Duxbury <bryanduxbury@apache.org>
Fri, 20 Mar 2009 01:51:16 +0000 (01:51 +0000)
committerBryan Duxbury <bryanduxbury@apache.org>
Fri, 20 Mar 2009 01:51:16 +0000 (01:51 +0000)
This patch adds the :enum_class key to FIELDS entries that are enums.

git-svn-id: https://svn.apache.org/repos/asf/incubator/thrift/trunk@756295 13f79535-47bb-0310-9956-ffa450edef68

compiler/cpp/src/generate/t_rb_generator.cc

index 9385282..3169556 100644 (file)
@@ -592,6 +592,10 @@ void t_rb_generator::generate_field_data(std::ofstream& out, t_type* field_type,
     out << ", :optional => true";
   }
 
+  if (field_type->is_enum()) {
+    out << ", :enum_class => " << full_type_name(field_type);
+  }
+
   // End of this field's defn
   out << "}";
 }