Class: IRB::Command::Workspaces

Inherits:
Base show all
Defined in:
lib/irb/command/pushws.rb

Direct Known Subclasses

PopWorkspace, PushWorkspace

Instance Attribute Summary

Attributes inherited from Base

#irb_context

Instance Method Summary collapse

Methods inherited from Base

category, description, execute, help_message, #initialize

Constructor Details

This class inherits a constructor from IRB::Command::Base

Instance Method Details

#execute(_arg) ⇒ Object


17
18
19
20
21
22
23
# File 'lib/irb/command/pushws.rb', line 17

def execute(_arg)
  inspection_resuls = irb_context.instance_variable_get(:@workspace_stack).map do |ws|
    truncated_inspect(ws.main)
  end

  puts "[" + inspection_resuls.join(", ") + "]"
end