>
> The storage methods may seem weird. The general rule for the #put and
> #delete method is
>
> - return nil when success
> - return true when the record is gone (update/deletion failed)
> - return the current version of the record when the caller's version is
> out of date (and there is a current version).
>
Oh, great. Now everything is a little bit more clear.
do_it(record) && raise ArgumentError.new("record out of date or gone")
Well, you can reverse the statement and say
do_it(record) || raise ArgumentError.new("record out of date or gone")
The second statement can also take advantage of the fact that in Ruby only
false/nil evaluates to false in a boolean comparison.
The recursion [usually] stops at the second "volley" : the client code
> either receives a "true" (gone) or a new version of the record with which
> the operation will succeed.
Thanks John, it is definitely more clear now.
--
Simone Carletti
Application Developer
Site & Blog: http://www.simonecarletti.com
Email: [email protected]
LinkedIn: http://linkedin.com/in/weppos
Skype: weppos
--
you received this message because you are subscribed to the "ruote users" group.
to post : send email to [email protected]
to unsubscribe : send email to [email protected]
more options : http://groups.google.com/group/openwferu-users?hl=en