Module: EvalIn

Defined in:
lib/eval-in.rb,
lib/eval-in/result.rb,
lib/eval-in/exceptions.rb

Overview

The primary namespace.

Author:

  • William Woodruff

Since:

  • 0.0.1

Defined Under Namespace

Classes: BadLanguageError, ConnectionError, EmptyCodeError, EvalInError, Result

Constant Summary collapse

VERSION =

The library's current version.

Since:

  • 0.0.1

"0.0.8"

Class Method Summary collapse

Class Method Details

.eval(lang, code) ⇒ EvalIn::Result

Evaluate some code in a given language.

Examples:

EvalIn.eval(:ruby, 'puts "Hello, World"') # => #<EvalIn::Result:0xNN>

Parameters:

  • lang (Symbol, String)

    the language to execute in

  • code (String)

    the program code to execute

Returns:

Since:

  • 0.0.1



19
20
21
# File 'lib/eval-in.rb', line 19

def self.eval(lang, code)
  EvalIn::Result.new(lang.to_s.downcase, code)
end