Get the list of instance variables that are meant to be serialized
map<String,Object>: Set of instance variables, per name
# File lib/ruby-serial/_object.rb, line 7 def get_instance_vars_to_rubyserial # Compute the list of attributes to serialize instance_var_names = [] klass = self.class if (klass.rubyserial_only_lst != nil) if (klass.dont_rubyserial_lst != nil) instance_var_names = klass.rubyserial_only_lst - klass.dont_rubyserial_lst else instance_var_names = klass.rubyserial_only_lst end elsif (klass.dont_rubyserial_lst != nil) instance_var_names = self.instance_variables - klass.dont_rubyserial_lst else instance_var_names = self.instance_variables end # Compute the resulting map instance_vars = {} instance_var_names.each do |sym_var| instance_vars[sym_var.to_s] = self.instance_variable_get(sym_var) end return instance_vars end
Set the list of instance variables that were serialized
instance_vars (map<String,Object>): Set of instance variables, per name
# File lib/ruby-serial/_object.rb, line 34 def set_instance_vars_from_rubyserial(instance_vars) instance_vars.each do |var_name, value| self.instance_variable_set(var_name.to_sym, value) end end