Class: Prremote::Commands::EvalCmd
- Inherits:
-
Object
- Object
- Prremote::Commands::EvalCmd
- Defined in:
- lib/prremote/commands/eval_cmd.rb
Instance Method Summary collapse
- #call(expr) ⇒ Object
-
#initialize(port:, baud:) ⇒ EvalCmd
constructor
A new instance of EvalCmd.
Constructor Details
#initialize(port:, baud:) ⇒ EvalCmd
Returns a new instance of EvalCmd.
7 8 9 10 |
# File 'lib/prremote/commands/eval_cmd.rb', line 7 def initialize(port:, baud:) @port = port @baud = baud end |
Instance Method Details
#call(expr) ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'lib/prremote/commands/eval_cmd.rb', line 12 def call(expr) tmp = Tempfile.new(['prremote_eval', '.rb']) tmp.write(expr) tmp.flush Run.new(port: @port, baud: @baud).call(tmp.path) ensure tmp&.close! end |