08 Mar '12, 2am

Jay Fields Thoughts: Ruby: State pattern using Modules and Facets:

"each method is protected so they must be accessed via the delegations, and an error will occur if they are accessed directly" You got me here. Till now I used to think that Ruby copies all the definition of a module into the definition of the class that includes it. Going by that logic, I couldn't explain your program's behavior as name method would be redefined and the modules' methods would be lost... I consulted "Programming Ruby": If a module is included within a class definition, the module's constants, class variables, and instance methods are effectively bundled into an anonymous (and inaccessible) superclass for that class. In particular, objects of the class will respond to messages sent to the module's instance methods. Your program made better sense now. The original definitions were not lost as they reside in a superclass (anonymous one). However this brought ...

Full article: http://blog.jayfields.com/2007/08/ruby-state-pattern-usin...

Tweets

Jay Fields' Thoughts: Ruby: Calling methods of ...

blog.jayfields.com 08 Mar '12, 2am

If a module is included within a class definition, the module's constants, class variables, and instance methods are effec...

Metaprogramming in Ruby: It’s All About the Self

yehudakatz.com 07 Mar '12, 8am

@wycats Right. That is why they are unnecessary and only confuse developers. I didn’t see this until I happened to discove...

@MikeG1 can you promote rails-api on Thanks!

afreshcup.com 12 Mar '12, 4pm

is Mike Gunderloy's software development weblog, covering Ruby on Rails and whatever else I find interesting in the univer...

Top Ruby Article: With Apologies, Some Senseles...

gilesbowkett.blogspot.com 07 Mar '12, 11pm

lost an argument with me on GitHub ranted about it on his blog: Giles... bemoans bundler, because typing "bundle exec" rep...

finally added a twitter link for each post on J...

blog.jayfields.com 04 Mar '12, 11am

The point I was trying to get at was: how does this scale? If every developer chooses what is best for them, is that neces...

#Ruby for other languages: ...the main differen...

ruby-lang.org 07 Mar '12, 2am

When you first look at some Ruby code, it will likely remind you of other programming languages you’ve used. This is on pu...

I love Ruby because

rubyflow.com 12 Mar '12, 8pm

I love Ruby because ... Posted by rtdp on March 12, 2012 — 0 comments I really love ruby language, and so do many folks us...

Campbell's to stop using BPA in soup cans

Campbell's to stop using BPA in soup cans

greenbiz.com 07 Mar '12, 1am

You won't find it on the list of ingredients, but many cans of Campbell's soup come with a bit of bisphenol-A, which helps...