From afa1b47e60c4ffba554f6187d84fd20cd514f51d Mon Sep 17 00:00:00 2001 From: Bryan Duxbury Date: Fri, 20 Mar 2009 01:51:16 +0000 Subject: [PATCH] THRIFT-245. rb: FIELDS constant should contain name of enumerated type for enum fields 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 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/compiler/cpp/src/generate/t_rb_generator.cc b/compiler/cpp/src/generate/t_rb_generator.cc index 93852821..3169556f 100644 --- a/compiler/cpp/src/generate/t_rb_generator.cc +++ b/compiler/cpp/src/generate/t_rb_generator.cc @@ -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 << "}"; } -- 2.17.1