Word and Phrase Drills

Card Set Information

Word and Phrase Drills
2015-04-28 09:57:31

Some word and phrase drills for ruby
Show Answers:

  1. class
    Tell Ruby to make a new type of thing
  2. object
    Two meanings: the most basic type of thing, and any instance of some thing
  3. instance
    What you get when you tell Ruby to create a class
  4. def
    How to you define a function inside a class
  5. @
    Inside the functions in a class, @ is a variable for the instance/object being accessed
  6. inheritance
    The concept that one class can inherit traits from another class
  7. composition
    The concept that a class can be composed of other classes as parts
  8. attribute
    A property classes have that are from composition and are usually variables
  9. is-a
    A phrase to say that something inherits from another
  10. has-a
    A phrase to say something is composed of other things or has a trait
  11. class X(Y)
    Create a class called X this is-a Y
  12. Class X(object): def initialize(J)
    Class X has-a initialise that takes a J parameter
  13. Class X(object): def M(J)
    Class X has a function named M that takes a J parameter
  14. foo = X()
    Set foo to an instance of class X
  15. foo.M(J)
    From foo get M and call it with parameter J
  16. foo.K = Q
    From foo get attribute K and set it to Q