Class: Resty::Repl
Instance Attribute Summary collapse
-
#interrupted ⇒ Object
Returns the value of attribute interrupted.
-
#options ⇒ Object
Returns the value of attribute options.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(resty_options) ⇒ Repl
constructor
A new instance of Repl.
- #readline(current_prompt) ⇒ Object
Constructor Details
#initialize(resty_options) ⇒ Repl
Returns a new instance of Repl.
9 10 11 12 13 14 15 16 17 |
# File 'lib/resty/repl.rb', line 9 def initialize() @options = Resty::Options.new() Pry.config.prompt = [ proc { "resty> " }, proc { "*>" }] Pry.config.history.file = "~/.ruby_resty_history" Pry.config.print = proc do |output, value| output.puts(Resty::PrettyPrinter.new(, value).generate) end end |
Instance Attribute Details
#interrupted ⇒ Object
Returns the value of attribute interrupted.
7 8 9 |
# File 'lib/resty/repl.rb', line 7 def interrupted @interrupted end |
#options ⇒ Object
Returns the value of attribute options.
7 8 9 |
# File 'lib/resty/repl.rb', line 7 def @options end |
Class Method Details
.start(resty_options) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/resty/repl.rb', line 19 def self.start() new().tap do |repl| Pry.config.input = repl repl..pry end end |
Instance Method Details
#readline(current_prompt) ⇒ Object
26 27 28 |
# File 'lib/resty/repl.rb', line 26 def readline(current_prompt) Readline.readline(current_prompt) end |