Class: Pry::Result
Overview
Wraps the return result of process_commands, indicates if the result IS a command and what kind of command (e.g void)
Instance Attribute Summary collapse
-
#retval ⇒ Object
readonly
Returns the value of attribute retval.
Instance Method Summary collapse
-
#command? ⇒ Boolean
Is the result a command?.
-
#initialize(is_command, retval = nil) ⇒ Result
constructor
A new instance of Result.
-
#void_command? ⇒ Boolean
Is the result a command and if it is, is it a void command? (one that does not return a value).
Constructor Details
#initialize(is_command, retval = nil) ⇒ Result
Returns a new instance of Result.
400 401 402 403 |
# File 'lib/pry/command_set.rb', line 400 def initialize(is_command, retval = nil) @is_command = is_command @retval = retval end |
Instance Attribute Details
#retval ⇒ Object (readonly)
Returns the value of attribute retval.
398 399 400 |
# File 'lib/pry/command_set.rb', line 398 def retval @retval end |
Instance Method Details
#command? ⇒ Boolean
Is the result a command?
407 408 409 |
# File 'lib/pry/command_set.rb', line 407 def command? @is_command end |
#void_command? ⇒ Boolean
Is the result a command and if it is, is it a void command? (one that does not return a value)
414 415 416 |
# File 'lib/pry/command_set.rb', line 414 def void_command? retval == Command::VOID_VALUE end |