Class: IRB::ExtendCommand::Whereami

Inherits:
Nop show all
Defined in:
lib/irb/cmd/whereami.rb

Instance Attribute Summary

Attributes inherited from Nop

#irb_context

Instance Method Summary collapse

Methods inherited from Nop

execute, #initialize, #irb

Constructor Details

This class inherits a constructor from IRB::ExtendCommand::Nop

Instance Method Details

#executeObject



9
10
11
12
13
14
15
16
# File 'lib/irb/cmd/whereami.rb', line 9

def execute(*)
  code = irb_context.workspace.code_around_binding
  if code
    puts code
  else
    puts "The current context doesn't have code."
  end
end