module Nuggets::Object::MSendMixin

Public Instance Methods

msend(*messages) → anArray click to toggle source

Sends object multiple messages and returns an array of the individual return values.

# File lib/nuggets/object/msend_mixin.rb, line 36
def msend(*messages)
  hash = messages.last.is_a?(::Hash) ? messages.pop : {}
  (messages + hash.to_a).map { |msg| send(*msg.is_a?(::Array) ? msg : [msg]) }
end