Class: Pry::Result

Inherits:
Object show all
Defined in:
lib/pry/command_set.rb

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

Instance Method Summary collapse

Constructor Details

#initialize(is_command, retval = nil) ⇒ Result

Returns a new instance of Result.



426
427
428
# File 'lib/pry/command_set.rb', line 426

def initialize(is_command, retval = nil)
  @is_command, @retval = is_command, retval
end

Instance Attribute Details

#retvalObject (readonly)

Returns the value of attribute retval.



424
425
426
# File 'lib/pry/command_set.rb', line 424

def retval
  @retval
end

Instance Method Details

#command?Boolean

Is the result a command?

Returns:

  • (Boolean)


432
433
434
# File 'lib/pry/command_set.rb', line 432

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)

Returns:

  • (Boolean)


439
440
441
# File 'lib/pry/command_set.rb', line 439

def void_command?
  retval == Command::VOID_VALUE
end