lib/scrimp/thrift_util.rb
# Converts a Thrift union to a hash (suitable for conversion to json).
Converts a Thrift union to a hash (suitable for conversion to json).
Converts a Thrift union to a hash ( suitable for conversion to json ) .
def thrift_union_to_json_map(union, klass)
        set_field = union.get_set_field.to_s
        field = klass::FIELDS.values.find { |f| f[:name] == set_field }
        { set_field => thrift_type_to_json_type(union.get_value, field) }
      end
def thrift_union_to_json_map ( union , klass ) set_field = union . get_set_field . to_s field = klass :: FIELDS . values . find { | f | f [ :name ] == set_field } { set_field => thrift_type_to_json_type ( union . get_value , field ) } end
Converts a Thrift union to a hash (suitable for conversion to json).
Converts a Thrift union to a hash ( suitable for conversion to json ) .
union
klass