31 Mar '13, 1pm

@josh_cheek Apparently it has. Why, then, can we say `self.setter=` but not `self.getter`

class Counter def initialize self.count = 0 end def increment1 self.count = count + 1 end def increment2 self.count = self.count + 1 end def increment3 self.count += 1 end private attr_accessor :count end counter = Counter.new counter.increment1 rescue $!.message # => 1 counter.increment2 rescue $!.message # => "private method `count' called for #<Counter:0x007f8c998c7c60 @count=1>" counter.increment3 rescue $!.message # => "private method `count' called for #<Counter:0x007f8c998c7c60 @count=1>" (counter.count = 0) rescue $!.message # => "private method `count=' called for #<Counter:0x007f8c998c7c60 @count=1>" So in Counter#increment1, we can see that we can invoke Counter#count=, even though it's private. But in increment2, we try `self.count`, which raises a NoMethodError, because we're calling a private method with an explicit receiver. But isn't that what we're doing w...

Full article: http://www.ruby-forum.com/topic/4412554

Tweets

We can all help influence Government! Visit and...

wildlifetrusts.org 30 Mar '13, 3pm

Dear MCZ Team, I fully support the designation of an ecologically coherent network of Marine Conservation Zones. I urge th...

well if your able to somehow order from Footloc...

footlocker.eu 02 Apr '13, 9pm

਍ℼ佄呃偙⁅瑨汭倠䉕䥌⁃ⴢ⼯㍗⽃䐯䑔堠呈䱍ㄠ〮吠慲獮瑩潩慮⽬䔯≎∠瑨灴⼺眯睷眮⸳牯⽧剔砯瑨汭⼱呄⽄桸浴ㅬ琭慲獮瑩潩慮⹬瑤≤ാ㰊瑨汭砠汭獮∽瑨灴⼺眯睷眮⸳牯⽧㤱㤹砯瑨汭㸢਍格慥⁤摩∽瑣ぬ弰效摡∱㰾楴汴㹥਍三歩⁥楁⁲慍⁸‱楍慬獑簠眠睷昮潯汴捯敫⹲...

Here is a good idea: The Personal Subway Car wh...

treehugger.com 01 Apr '13, 4pm

April Fools jokes are controversial on TreeHugger; some of us love them and others do not. One, who shall remain nameless,...

What can I do if developer's defect rectificati...

forums.condosingapore.com 03 Apr '13, 2pm

Had similar problem as u n this is what I did:- 1) get a lawyer 2) take photos of defects 3) keep a copy of defect list wi...

New blog post : Lets see if you can do this :P

rinaz.net 05 Apr '13, 6am

New blog post : rinaz.net/2013/04/bend/ Lets see if you can do this :P 4 hours ago Had a dream involving Mila Kunis and Ja...

Note To Self…

Note To Self…

ronisweigh.com 27 Mar '13, 3am

A few days ago I made The 6-Ingredient, Family-Approved, Pork Loin Dinner purposefully with 2 pork loins so I would have l...

Around The World Tour On a Private Jet With Four Seasons via @zite

Around The World Tour On a Private Jet With Fou...

elitechoice.org 31 Mar '13, 2pm

Quite naturally, all guests will get to stay in Four Seasons hotels and resorts in these places. They will get an experien...