Ruby Terms

Card Set Information

Ruby Terms
2011-09-11 14:22:42
ruby programming computers

Ruby programming language terms and examples.
Show Answers:

  1. Matz?
    The creator of Ruby.
  2. Class
    A collection of code, including methods and variables called members. The code in a a class sets the rules for objects of the given class.
  3. Instance Variable
    A variable associated with an instance of a class. Prefixed with a single @ sign.
  4. Reserved Word
    Another name for Keyword. Words set aside by Ruby and have a special meaning to the Ruby interpreter.
  5. Regular Expression
    A consice sequence or pattern of special characters used to search for strings.
  6. String
    A sequence of objects, usually characters.
  7. Variable
    A name that may be assigned a quantity or a value.
  8. Range
    A way of representing inclusive and exclusive ranges of objects, usually numbers.
  9. Hash
    An unordered collection of data where keys and values are mapped.
  10. Array
    A data structure containing an ordered list of elements. Starting with an index of Zero.
  11. Argument
    • Variables passed to a method.
    • ie: hello(name) the variable 'name' is an argument
  12. Block
    a nameless function always associated with a method call. Contained in a pair of braces {} or do/end
  13. Child Class
    A class derived from a parent or super class
  14. Superclass
    The parent class. A child class is derived from the parent or superclass
  15. Global Variable
    A variable whose scope includes the entire program.
  16. Class Variable
    • A variable that can be shared between objects of a given class
    • Prefixed with two @@ signs.
  17. Float
    • Objects that represent real numbers.
    • ie: 1.0 12.50
  18. Method
    • A named collecion of statements with or without argument, and a return value.
    • A member of a class.
  19. Member
    Variables and methods are considered members of a class or object.
  20. def
    Keyword. defines method
  21. Expression
    A programming statement that includes keywords, operators, variables and so forth. Returns a value.
  22. BEGIN
    Code, enclosed in {and}, to run before the program runs.
  23. END
    Code enclosed in {and}, to run when the program ends.
  24. alias
    Creates and alias for an existing method, operator, or global variable.
  25. and
    Logical operator; same as && exept and has lowered precedence. Compare with ‘or’
  26. break
    Terminates a ‘while’ or ‘until’ loop or a method inside a block.
  27. case
    Compares an expression with a matching ‘when’ clause; closes with ‘end’ see ‘when’
  28. ==
    Compares two values.
  29. !=
    Not equal.
  30. =
    Assigns value to a variable name. ie name = Chad Jemmett
  31. $
    • A global variable.
    • When this precedes a word, it means the word is a global variable.
  32. Modules
    • A way of grouping together methods, classes and constants. Modules give you 2 major benefits
    • They provide a namespace and prevent name clashes
    • The implement the mixin facility.
  33. Iterator
    Methods that act like loops
  34. Loops
    Used to execute the same block of code for a specified number of times.