Class: Redcar::Mirah::ReplMirror::Evaluator
- Inherits:
-
Object
- Object
- Redcar::Mirah::ReplMirror::Evaluator
- Defined in:
- lib/mirah/repl_mirror.rb
Instance Attribute Summary collapse
-
#output ⇒ Object
readonly
Returns the value of attribute output.
Instance Method Summary collapse
- #execute(command) ⇒ Object
-
#initialize ⇒ Evaluator
constructor
A new instance of Evaluator.
- #inspect ⇒ Object
Constructor Details
#initialize ⇒ Evaluator
Returns a new instance of Evaluator.
33 34 35 36 37 38 |
# File 'lib/mirah/repl_mirror.rb', line 33 def initialize Mirah.load_dependencies @binding = binding @impl = Java::MirahImpl::Mirah.new @output = nil end |
Instance Attribute Details
#output ⇒ Object (readonly)
Returns the value of attribute output.
31 32 33 |
# File 'lib/mirah/repl_mirror.rb', line 31 def output @output end |
Instance Method Details
#execute(command) ⇒ Object
44 45 46 |
# File 'lib/mirah/repl_mirror.rb', line 44 def execute(command) @impl.instance_eval(command).inspect end |
#inspect ⇒ Object
40 41 42 |
# File 'lib/mirah/repl_mirror.rb', line 40 def inspect "main" end |