Class: IRB::Kit::Handlers::ConstantEditor
- Defined in:
- lib/irb/kit/handlers/constant_editor.rb
Overview
Handles editing of constant source code.
Instance Method Summary collapse
- #call(name) ⇒ Object
-
#initialize(editor: Editor.new) ⇒ ConstantEditor
constructor
A new instance of ConstantEditor.
Constructor Details
#initialize(editor: Editor.new) ⇒ ConstantEditor
Returns a new instance of ConstantEditor.
8 9 10 11 |
# File 'lib/irb/kit/handlers/constant_editor.rb', line 8 def initialize(editor: Editor.new, **) @editor = editor super(**) end |
Instance Method Details
#call(name) ⇒ Object
13 14 15 16 17 |
# File 'lib/irb/kit/handlers/constant_editor.rb', line 13 def call name editor.call(*Object.const_source_location(name)) rescue NameError io.puts "ERROR (invalid constant): #{name.inspect}." end |