One thing you can do is use a gem like byebug, put a breakpoint above the
code you want to find it's location and use this:
method(:name_of_method).source_location
if you put a breakpoint inside your routes.rb and call:
method(:get).source_location
it returns something like:
./gems/actionp
San Ji, thank for your answer. But how does Ruby runtime know which
function to call? There must be a way for human to mimic that... Right?
On Sat, Mar 21, 2020 at 10:35 AM San Ji wrote:
> To my knowledge, what you are looking for is not possible for Ruby.
>
> What you got in RubyMine is the
To my knowledge, what you are looking for is not possible for Ruby.
What you got in RubyMine is the closest, basically it index all words and apply
some language heuristics to scope down choices. This is good enough in most
cases.
Systematic way to do it is impossible because Ruby supports meta
How does one figure out where a definition of a function is given its call
in Ruby on Rails code? For example, let's suppose, I didn't know what
config/routes.rb is for. And I was looking at it and wanted to know what
the function get does. It's not defined in routes.rb itself. There are no
4 matches
Mail list logo