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 6362463
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:54:40+00:00 2026-05-24T23:54:40+00:00

I am just getting started with Ruby on Rails. Coming from the Java world,

  • 0

I am just getting started with Ruby on Rails. Coming from the Java world, one thing that I am wondering is how do Ruby/Rails developers find out where methods are actually defined.

I am used to just clicking on the method in Eclipse to find where is is defined even in third party libraries (supposing I have the source code).

A concrete example: I am trying to find out how the Authlogic gem apparently changes the constructor of my User class to require an additional parameter (called :password_confirmation) even though the User class doesn’t even inherit from anything related to Authlogic.

Probably I am just overlooking something really obvious here (or maybe I still can’t wrap my head around the whole “convention over configuration” thing ;-))

  • 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-24T23:54:41+00:00Added an answer on May 24, 2026 at 11:54 pm

    The Pry gem is designed precisely for this kind of explorative use-case.

    Pry is an interactive shell that lets you navigate your way around a program’s source-code using shell-like commands such as cd and ls.

    You can pull the documentation for any method you encounter and even view the source code, including the native C code in some cases (with the pry-doc plugin). You can even jump directly to the file/line where a particular method is defined with the edit-method command. The show-method and show-doc commands also display the precise location of the method they’re acting on.

    Watch the railscast screencast for more information.

    Here are some examples below:

    pry(main)> show-doc OpenStruct#initialize
    
    From: /Users/john/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/ostruct.rb @ line 46:
    Number of lines: 11
    
    visibility:  private
    signature:  initialize(hash=?)
    
    Create a new OpenStruct object.  The optional hash, if given, will
    generate attributes and values.  For example.
    
      require 'ostruct'
      hash = { "country" => "Australia", :population => 20_000_000 }
      data = OpenStruct.new(hash)
    
      p data        # -> <OpenStruct country="Australia" population=20000000>
    
    By default, the resulting OpenStruct object will have no attributes.
    
    pry(main)> 
    

    You can also look up sourcecode with the show-method command:

    pry(main)> show-method OpenStruct#initialize
    
    From: /Users/john/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/ostruct.rb @ line 46:
    Number of lines: 9
    
    def initialize(hash=nil)
      @table = {}
      if hash
        for k,v in hash
          @table[k.to_sym] = v
          new_ostruct_member(k)
        end
      end
    end
    pry(main)> 
    

    See http://pry.github.com for more information 🙂

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

Sidebar

Related Questions

I'm just getting started with Ruby on Rails development and I have a question
I'm just getting started with Ruby and Ruby on Rails, so excuse me if
I'm just getting started with Custom User Controls in C# and I'm wondering if
I am just getting started learning rails. I am building my first app using
So I'm getting started learning Rails. Now that Rails 3 is out, I want
Just getting started with Linq to SQL so forgive the newbie question. I'm trying
Just getting started using MVC in ASP.NET, I'm going to have it so users
I am just getting started with flex and am using the SDK (not Flex
I'm just getting started with learning about Unit testing (and TDD in general). My
I'm just getting started working with foreign keys for the first time and I'm

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.