L
L
lightharut2017-10-02 12:02:00
Ruby on Rails
lightharut, 2017-10-02 12:02:00

How to find a hint about a method and its parameters from the command line?

I am a newbie developer in ruby ​​on rails. And it would help me a lot if I could get a hint about the parameters of a method (eg File.open) from the command line. For example help File.open.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
N
N. Bekseitov, 2017-10-02
@nbekseitov

Ruby Ri Tool

O
oh_shi, 2017-10-02
@oh_shi

Replace default irb with pry

gem install pry
gem install pry-doc (если нужна стандартая либа)
pry

Now a lot of useful commands are available to you (the whole list is available through help), for example:
"ls File" - list of all methods for the File class
object "$ File.open" - source code of the method
"? File.open" - docks to this method

A
Andrey Demidenko, 2017-10-02
@Dem1

irb

--help
Array#sort
Array.new
File.open

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question