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

category, description, execute, #initialize

Constructor Details

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

Instance Method Details

#executeObject



13
14
15
16
17
18
19
20
# File 'lib/irb/cmd/whereami.rb', line 13

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