Screencast Special Character Methods Ruby

  • Aimee Booth
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. Boris said

    Awesome! Thank you.

  2. Charles Green said

    Great video. You mentioned that the boolean operator "?" is just part of a naming convention. Is this different then in Rails w/ RSpec where it can be converted into "be_true" or is that just part of their DSL?

  3. Faculty

    Aimee Booth said

    Thanks, Charles! You're right - the ability to convert booleans to be_true is part of the RSpec DSL. We talk about this in the Testing With RSpec, if you want to learn more about it.

  4. Humberto Martin del Campo said

    Great screencast.

  5. Andrew Tinkov said

    Nice screencast, thx! I have a question. Can these special character methods be combined? Lets say we have method "sort", which sorts an array and returns true if changes where made and false otherwise. Can I check the result of the sort action by calling "sort!?" ?

  6. Code School Support said

    Hi Andrew! Ruby doesn't provide any method like sort!?, and even though you could probably write your own, it's not really a good idea to create a method like that. If you want to check if changes were made in calling sort!, you can create a method like sorted? which could contain sort! and compare the original array to the sorted array.

  7. Matthew Fritz said

    Thank you for this. As a new rubyist it certainly answered one of my "newbie" ruby questions.

  8. kiffing said

    Nice and clear, well done.

About This Screencast

As a Rubyist you're likely to encounter some strange methods ending in question marks and exclamation marks. What are those and how should you approach them?

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

Enroll Now