lib/scrimp/thrift_util.rb
def thrift_struct_to_json_map(struct, klass)
        klass::FIELDS.values.each_with_object({}) do |field, h|
          val = struct.public_send(field[:name])
          h[field[:name]] = thrift_type_to_json_type(val, field) if val
        end
      end
# Converts a Thrift struct to a hash (suitable for conversion to json).
Converts a Thrift struct to a hash (suitable for conversion to json).
Converts a Thrift struct to a hash ( suitable for conversion to json ) .
def thrift_struct_to_json_map(struct, klass)
        klass::FIELDS.values.each_with_object({}) do |field, h|
          val = struct.public_send(field[:name])
          h[field[:name]] = thrift_type_to_json_type(val, field) if val
        end
      end
def thrift_struct_to_json_map ( struct , klass ) klass :: FIELDS . values . each_with_object ( { } ) do | field , h | val = struct . public_send ( field [ :name ] ) h [ field [ :name ] ] = thrift_type_to_json_type ( val , field ) if val end end
Converts a Thrift struct to a hash (suitable for conversion to json).
Converts a Thrift struct to a hash ( suitable for conversion to json ) .
struct
klass