Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7626933
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:23:32+00:00 2026-05-31T05:23:32+00:00

Say I am running IRB and I type this into the console: def full_name(first,

  • 0

Say I am running IRB and I type this into the console:

def full_name(first, last)
   puts "Your full name is: #{first, ' ', last}"
end

Say, that I wanted to edit that to include the parameter middle, how would I just bring back up that same method and edit the parameter list and edit the puts statement without having to retype the entire method?

P.S. I know that this example is simple and I could easily just retype the method, but I have much larger methods I am experimenting with and I am using this simple one for brevity.

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:23:33+00:00Added an answer on May 31, 2026 at 5:23 am

    You can’t. Other than retyping/repasting it, or pressing ↑ to get all the previous statements, but for longer methods this can be very confusing.

    Why not type your code in an editor, and then do load 'mycode.rb' in IRb? This is essentially equivalent to copy-and-pasting the text in, and calling load 'myfile.rb' again will, as usual, override the existing method definitions.

    Or, even better, use Pry instead of IRB as suggested by bannister below (I completely replaced IRB with Pry long ago myself).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The docs for the python dev server say this about running tasks: When your
Say I have a current running process known, how can I turn this into
Say suppose I am running a java program through command line. And this program
I will say when I first got carrierwave up and running, everything was working
I'm running into some problems trying to understand how I can do this. Let's
Didn't see a question similar to this, so here goes: Let's say I'm running
Let's say I have one thread running (I'm creating many instances of this thread),
Let me first say that I am running on a shared linux server with
Let's say I have a greasemonkey-type user script running on a page that has
First off let me say I am running on SQL Server 2005 so I

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.