-
Use
is_a?
,kind_of?
,instance_of?
method to check type of any variable -
Explain the usage of method in detail, as a comments before method
-
Use
compact
method to remove nil from arrays -
Use
tap
method as follows, avoid writing an extra line to return object Instead of,def update_params(params)
params[:foo] = 'bar'