Sha256: 4ec63c7bf676ae3f6d816427cb20aa1a127cf1073eadc6b0dee116c3c0fc8817

Contents?: true

Size: 445 Bytes

Versions: 2

Compression:

Stored size: 445 Bytes

Contents

class RubyProcess
  #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

2 entries across 2 versions & 2 rubygems

Version Path
ruby_process-0.0.13 cmds/str_eval.rb
RubyProcess-0.0.12 cmds/str_eval.rb