Ruby - Dinge, die ich mir einfach nicht merken kann

Hier sollen einfach ein paar Ruby Klassen und ihre Methoden stehen, die ich zwar oft brauche, mir aber einfach nicht merken kann.

  • language constructs
    • Loops
      • case:
        case xxx
        when y
        #do
        when z
        #do
        else
        #do
        end
  • Object
    • respond_to?: Returns true if obj responds to the given method. Private methods are included in the search only if the optional second parameter evaluates to true.
  • Array
    • delete:Deletes items from self that are equal to obj. If the item is not found, returns nil. If the optional code block is given, returns the result of block if the item is not found.
  • Enumerable
    • include?:Returns true if any member of enum equals obj. Equality is tested using ==.

Antwort schreiben