Call An Objects Private Methods In Ruby

Posted By Weston Ganger

Sometimes you need to run an objects private method from the console or something.

For example your model may look something like this:

@post.send(:set_initial_values)

# or with arguments

@post.send(:update_title, true)

Related External Links:

Article Topic:Software Development - Ruby / Rails

Date:March 05, 2016