Well I found out either way I go with passing a block to Button.new(),
it
doesn’t work very well because subclasses’ initialize() is called
afterwards
and clobbers the changes So I just have another method called
init().
…
def init()
yield self
return self
end
…
button = Button.new.init do |b|
b.caption = ‘Click Me!’
end
I would say it should be obj.x, as I didn’t propose to allow .meth as a
general shortcut for self.meth, but only when it is a left hand side of
an
asignment.
But this leads to:
meth .attr=42
I would say that would also be meth.attr=42 and not meth(.attr=42). If
you
want the latter, then use brackets.