From: Andrew Wagner Date: 2010-09-14T23:56:53+09:00 Subject: Re: method! and method? --001636c5addf1f2cbe0490396c5e Content-Type: text/plain; charset=UTF-8 This blog posthas an interesting perspective on the topic. On Tue, Sep 14, 2010 at 10:44 AM, Brian Candler wrote: > Gene Angelo wrote: > > I am trying to find the meaning of ! and ? appended to method names but > > I cannot find what they mean. Can someone explain? > > They don't mean anything - they are just part of the name. That is, in > > str.downcase! > > the method you are calling is called :downcase! - which is a distinct > method to :downcase > > However, there are conventions as to when they should be used. Methods > ending ? typically query the properties of some object and return a > boolean-like result, while methods ending ! are "dangerous" in some way, > such as modifying the state of the object when a non-modifying > alternative method is available. > -- > Posted via http://www.ruby-forum.com/. > > --001636c5addf1f2cbe0490396c5e--