Nodewrap is Ruby module that provides direct access to Ruby's internal node structure. Originally this started as a proof-of-concept to allow Node objects to be dumped and loaded using Ruby's builtin marshalling mechanism. Methods to dump and load classes and modules are were also added, and with a little work, nodewrap can be used to dump entire class hierarchies from one Ruby process and load them into another.
Gemfile gem 'nodewrap', '~> 0.5.0'
install gem install nodewrap