I came across this project the other day and thought it was an interesting way to augment learning and using Ruby.
Suggest gives objects two extra methods;
what_mutates?. Both methods take a result that you are interested in and return the methods you could call on the object to get that result.
require 'suggest' [1,2,3].what_returns? 1 => [:first, :min]
I can see this being useful when you're tooling about in
irb and you're sure that there is a method that does the thing you want but you can't remember it. It could save a trip to search the docs and could even suggest better methods than the one you were thinking of.
Check it out on GitHub:
tells you which method does the thing you want to do
I don't recommend you ship this in your Gemfile. Keep it in your system's gems (e.g.
gem install) and load it as needed (e.g.
RUBY_OPT=-rsuggest irb, etc)
gem install suggest_rb
require 'suggest' # Object#what_returns? tells you which method returns the value [1,2,3].what_returns? 1 => [:first, :min] # You can also specify the args you want that method to take [1,2,3].what_returns? , args:  => [:first, :take, :grep, :min] # By default, it only returns methods that don't mutate the object [1,2,3].what_returns? , args: , allow_mutation: true => [:first, :take, :shift,…