Close
Glad You're Ready. Let's Get Started!

Let us know how we can contact you.

Thank you!

We'll respond shortly.

PIVOTAL LABS
= != send(:=)

Interestings

Sending Assignment

Ruby enforces that any assignment returns the RHS. Or at least it does when you call it normally.

class Foo
def bar=(x)
42
end
end

Foo.new.bar = "sup"

"sup"

Foo.new.send(:bar=, "sup")

42

(looks like its fixed in newer versions of 2.0)

Comments
Post a Comment

Your Information (Name required. Email address will not be displayed with comment.)

* Copy This Password *

* Type Or Paste Password Here *