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

  • SEARCH
  • Home
  • 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 8718123
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T06:27:56+00:00 2026-06-13T06:27:56+00:00

Coming from working with Java in Eclipse, it’s always been extremely easy for me

  • 0

Coming from working with Java in Eclipse, it’s always been extremely easy for me to determine where a method was defined: simply ctrl+click the method call and it brings you to the method definition in its containing class. Obviously it’s Eclipse that makes a lot of this happen, but even with plain old Java, we still have the import statements to fall back on.

Method lookups seem to be very difficult with Rails development.

Here’s an example:

require 'test_helper'

class UserStoriesTest < ActionDispatch::IntegrationTest
  fixtures: products

  LineItem.delete_all
  Order.delete_all
  ruby_book = products(:ruby)

  get "/"
  assert_response :success
  assert_template "index"

  cart = Cart.find(session[:cart_id])
  assert_equal 1, cart.line_items.size
  assert_equal ruby_book, cart.line_items[0].product

  get "/orders/new"
  assert_response :success
  assert_template "new"
end

Let’s say I wanted to take a closer look at the assert_equal method. If I was working with Java and the class that contained assert_equal would probably be described by an import statement in this class with its location explicitly specified (e.g. java.lang.SomeCoreClass). Since I have no idea where the hell this method is defined, what I end up doing is Googling for “assert_equal” to find that the method I’m investigating is (probably and hopefully) defined in Test::Unit::Assertions.

I’m interested to hear from a few people on their approaches to determining method locations.

  • 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-06-13T06:27:57+00:00Added an answer on June 13, 2026 at 6:27 am

    try this:

    class Bong
      def smoke
        puts "smoke"
      end
    end
    
    Bong.method(:smoke)
    Bong.method(:smoke).source_location
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm quite new to C# (coming from a Java background) and I'm working on
I'm working on my first project using Python 2.7. We're coming from a Java
I am coming from Java and am currently working on a C# project. What
Hi all, Very new to Erlang, coming from C/C++/Java. Been playing with code and
I've been having problems exporting my java project to a jar (from Eclipse). There
I'm coming from a MS SQL Server background. Working on a new project using
We're working in a Dynamic Data project that will handle entities coming from two
I am working on a very simple project to learn Rails better, coming from
I'm having a hard time working with arrays. Coming from AS2/AS3 and garbage collection
I am working on a streaming download (CSV) from Rails 3.2 and am coming

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.