Screencast Core Ruby Classes Ruby

  • Jay McGavren
Badge student

Locked Content

A subscription is required for viewing this video. Enroll now to get full access to all Code School courses and content.

Enroll Now Sign in


  1. Mike Stok said

    In the explanation of inject using bowling scores in a season it seems redundant to use sum += value at the end of the inject block as the inject will put the return value of the block into the "accumulator", so

    sum = scores.inject(0) do |accumulator, score| accumulator + score end

    works and might give more insight into how inject works.

  2. Faculty

    Jay McGavren said

    @mikestok right you are - the += is a little misleading. This would probably have been a better example:

    sum = scores.inject(0) {|sum, value| sum + value}

    Good catch!

  3. Eric Raio said

    Great screencast! Learned some new tricks that I can apply at work tomorrow. Thanks Jay!!

  4. Brian Kelly said

    Nicely done! It's always good to be reminded of/introduced to methods like these.

  5. madhermit said

    Very helpful. Thanks!

  6. David Douglas said

    gsub = "global substitute" (replaces globally) sub = "(local) substitute)"

  7. David Douglas said

    using global methods is not required to use the bang! methods.

    string.strip! works just fine

  8. David Douglas said

    %W can use any delimiter you like, not just "/". it could be %W[ ... ], etc

  9. David Douglas said

    same goes for %S, and there are probably others

  10. Clint Lenard said

    Great video! I'd love to see more like these, focused on just Ruby (not rails).

  11. Stefanos Ioannou Tou Andrikkou said

    Thanks Jay. Interesting video! Appreciating your effort.

About This Screencast

Jay McGavren gives an overview of a few Ruby Core Classes, covering examples from the String, Array, Hash, and Enumerable classes. If the Ruby language still feels new for you, this is definitely worth watching.

You need to be an enrolled student in order to view this video and subscribe.

Enroll Now