lib/scrimp/thrift_util.rb
# Finds all loaded Thrift struct classes, adds methods to them
# for building them from hashes, and saves the list of them for
# future reference.
Finds all loaded Thrift struct classes, adds methods to them
for building them from hashes, and saves the list of them for
future reference.
Finds all loaded Thrift struct classes adds methods to them for building them from hashes and saves the list of them for future reference .
def extend_structs
        @@all_structs = ObjectSpace.each_object(Module).
          select { |klass| Thrift::Struct > klass || Thrift::Union > klass }
        @@all_structs.each { |klass| klass.extend(JsonThrift) }
      end
def extend_structs @@all_structs = ObjectSpace . each_object ( Module ) . select { | klass | Thrift :: Struct > klass || Thrift :: Union > klass } @@all_structs . each { | klass | klass . extend ( JsonThrift ) } end
Finds all loaded Thrift struct classes, adds methods to them
for building them from hashes, and saves the list of them for
future reference.
Finds all loaded Thrift struct classes adds methods to them for building them from hashes and saves the list of them for future reference .