Class: Mysh::ExecHost

Inherits:
Object
  • Object
show all
Includes:
Math
Defined in:
lib/mysh/expression.rb

Overview

The mysh ruby expression processor.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#resultObject (readonly)

The result of the previous expression.


15
16
17
# File 'lib/mysh/expression.rb', line 15

def result
  @result
end

Instance Method Details

#execute(str) ⇒ Object

Process an expression.


18
19
20
21
22
23
24
# File 'lib/mysh/expression.rb', line 18

def execute(str)
  if str.start_with?('=')
    do_execute(str)
  else
    false
  end
end

#resetObject

Reset the state of the execution host.
Endemic Code Smells

  • :reek:UtilityFunction


29
30
31
32
# File 'lib/mysh/expression.rb', line 29

def reset
  Mysh.reset_host
  nil
end