Sha256: 3148dcd9e23c3e4938531085050ee65577ee351e8efd7a725a98788351464cdd

Contents?: true

Size: 453 Bytes

Versions: 5

Compression:

Stored size: 453 Bytes

Contents

class Ruby_process
  #Evalulates the given string in the process.
  #===Examples
  # rp.str_eval("return 10").__rp_marshal #=> 10
  def str_eval(str)
    send(:cmd => :str_eval, :str => str)
  end
  
  #Process-method for 'str_eval'.
  def cmd_str_eval(obj)
    #Lamda is used here because 'return' might be used in evalled code and thereby return an unhandeled object.
    return handle_return_object(lambda{
      eval(obj[:str])
    }.call)
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
ruby_process-0.0.9 cmds/str_eval.rb
ruby_process-0.0.8 cmds/str_eval.rb
ruby_process-0.0.7 cmds/str_eval.rb
ruby_process-0.0.5 cmds/str_eval.rb
ruby_process-0.0.4 cmds/str_eval.rb