diff options
Diffstat (limited to 'NEWS')
-rw-r--r-- | NEWS | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -22,10 +22,13 @@ with all sufficient information, see the ChangeLog file. * new method call syntax, `object.?foo', method #foo is called on `object' if it is not nil. - this is similar to `try!' in Active Support, except for: + this is similar to `try!' in Active Support, except: * method name is syntactically required obj.try! {} # valid obj.? {} # syntax error + * arguments are evaluated only if a call is made: + obj.try!(:foo, bar()) # bar() is always evaluated + obj.?foo(bar()) # bar() is conditionally evaluated * attribute assignment is valid obj.?attr += 1 |