nuby question: question marks in method names

Discussion in 'Ruby' started by Edwin Eyan Moragas, Aug 30, 2004.

  1. Hi Guys,

    it's a bit hard to search for answers to this question so here goes.

    i've noticed methods that return booleans have a signature which looks like:
    object.something?

    in the course of looking for answers, seems like ? is part of the
    method, ie, 'something?'
    and this is the preferred way saying that something is returning a
    boolean value.

    1) is there any way to do this automatically?
    class X
    attr :some_bool
    def some_bool?
    @some_bool
    end
    end

    2) any tricks you might want to share?

    stp
    eyan
    --
    Edwin Eyan Moragas
    Main Expectorant

    haaktu technologies
    spewing spit since '73
     
    Edwin Eyan Moragas, Aug 30, 2004
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Bülent Keskin
    Replies:
    1
    Views:
    613
    Guy Soffer
    Aug 10, 2003
  2. Van Jacques

    nuby question re a method

    Van Jacques, Dec 10, 2003, in forum: Ruby
    Replies:
    0
    Views:
    87
    Van Jacques
    Dec 10, 2003
  3. Peña, Botp
    Replies:
    1
    Views:
    242
    Robert Klemme
    Jan 24, 2004
  4. Peña, Botp

    nuby: method defined in two classes

    Peña, Botp, Dec 7, 2005, in forum: Ruby
    Replies:
    2
    Views:
    87
    Joel VanderWerf
    Dec 7, 2005
  5. Su Zhang
    Replies:
    3
    Views:
    216
    Su Zhang
    Apr 18, 2011
Loading...

Share This Page