Hi,

I am a beginner in ruby and It try to undertand the concept of
"enum.chunk" in particular these 2 exemples (http://ruby-doc.org/core/
classes/Enumerable.html#M003131)

"  open("/usr/share/dict/words", "r:iso-8859-1") {|f|
    f.chunk {|line| line.ord }.each {|ch, lines| p [ch.chr,
lines.length] } "

and
"  sep = "-"*72 + "\n"
  IO.popen("svn log README") {|f|
    f.chunk {|line|
      line != sep || nil
    }.each {|_, lines|
      pp lines
    }
  }
"

What do those mean ? I can't understand the way it works...

Best regards,

Jr

-- 
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to