The RubyLeaning first Shoes programming course came to an end successfully yesterday. I'd been really enjoying this batch and learning a lot.
I got an VERY interesting behavior (code).
# sample52-render.rb
ROOMS.each_with_index do |r, i|
name, paths = r.chomp.split(':')
@rooms[i].style :name => name, :paths => paths
end
I have noticed that if we add an undefined option like :oops as one of the arguments, no error will occur and nothing will happen, it will just be ignored.
But I didn't understand the real effect of Shoes style method. We can add (use) any symbols as like as Ruby attr_accessor!!
We did this exercise in the first Shoes course. Then I could find this usage. ;-)

Is it confusing for you? Or curious? hahaha
I'm now thinking about next 2nd batch and going to prepare new exercises.
See you all in the next batch!!
ashbb
No comments:
Post a Comment