mirror of
https://github.com/edgecase/ruby_koans.git
synced 2026-04-15 07:23:19 -04:00
Added clarification note about sending messages.
This commit is contained in:
Binary file not shown.
@@ -63,6 +63,13 @@ class AboutMessagePassing < Neo::Koan
|
|||||||
assert_equal __([3, 4, nil, 6]), mc.send(:add_a_payload, 3, 4, nil, 6)
|
assert_equal __([3, 4, nil, 6]), mc.send(:add_a_payload, 3, 4, nil, 6)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# NOTE:
|
||||||
|
#
|
||||||
|
# Both obj.msg and obj.send(:msg) sends the message named :msg to
|
||||||
|
# the object. We use "send" when the name of the message can vary
|
||||||
|
# dynamically (e.g. calculated at run time), but by far the most
|
||||||
|
# common way of sending a message is just to say: obj.msg.
|
||||||
|
|
||||||
# ------------------------------------------------------------------
|
# ------------------------------------------------------------------
|
||||||
|
|
||||||
class TypicalObject
|
class TypicalObject
|
||||||
|
|||||||
Reference in New Issue
Block a user