Class: Rubel::Runtime::Console
- Inherits:
-
Object
- Object
- Rubel::Runtime::Console
- Includes:
- Core
- Defined in:
- lib/rubel/runtime/console.rb
Overview
Used for GQL console
Constant Summary collapse
- RESULT_PRINTER =
Prints string directly
proc do |output, value| if value.is_a?(String) output.puts value else ::Pry::DEFAULT_PRINT.call(output, value) end end
Instance Method Summary collapse
-
#console ⇒ Object
Starts the Pry console.
Methods included from Core
#execute, #method_missing, #sanitize!, #sanitized_proc
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class Rubel::Core
Instance Method Details
#console ⇒ Object
Starts the Pry console
32 33 34 35 36 37 38 39 |
# File 'lib/rubel/runtime/console.rb', line 32 def console require 'pry' puts "** Console Loaded" ::Pry.start(self, # input: LoggingPrompt.new, prompt: proc { |_, nest_level| "GQL: " }, print: RESULT_PRINTER) end |