There are three ways to invoke a method in ruby. Can you give me at least two?

Technology CommunityCategory: RubyThere are three ways to invoke a method in ruby. Can you give me at least two?
VietMX Staff asked 3 years ago

We are looking for the dot operator (or period operator), the Object#send method, or method(:foo).call

object = Object.new
puts object.object_id
 #=> 282660

puts object.send(:object_id)
 #=> 282660

puts object.method(:object_id).call # (Kudos to Ezra)
 #=> 282660