Private Methods vs Lambdas in Ruby

private def not_everyone_sees_me
# does something
end
def everyone_sees_me
# do something
# call private method to do more things
not_everyone_sees_me
end
def everyone_sees_me

def not_everyone_sees_me
end
not_everyone_sees_meend
def everyone_sees_me

not_everyone_sees_me = ->() {
}
not_everyone_sees_me.callend

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Krish @ Snowpal.com

Krish @ Snowpal.com

4 Followers

I am a Software Developer and Architect, and run the engineering team at Snowpal. Use our Web and Mobile Apps to manage all your projects!