Skip to main content
Caleb-Mitchell

RB129: Code Snippets

·1 min

Code Examples for RB129 Assessment Worksheet #

- Write a code snippet that exemplifies each concept - #

  1. Classes and Objects:
  2. Objects
  3. Classes
  4. Object Instantiation
  5. Instance Variables
  6. Instance Methods
  7. Class Variables
  8. Class Methods
  9. Instance Methods vs Class Methods
  10. Setter and Getter Methods
  11. Using attr_*
  12. Method Access Control
  13. Public
  14. Private
  15. Protected
  16. Inheritance
  17. Class Inheritance
  18. Interface Inheritance
  19. Method Lookup Path
  20. Object Methods
  21. Variable Scope with Inheritance
  22. Polymorphism & Encapsulation
  23. Polymorphism
  24. Polymorphism Through Inheritance
  25. Polymorphism Through Duck Typing
  26. Encapsulation
  27. Modules
  28. Mixin Modules
  29. Namespacing
  30. Module Methods
  31. Self
  32. Inside Instance Methods
  33. Inside Class Methods
  34. Inside Class Definitions
  35. Inside Mixin Modules
  36. Outside Any Class
  37. Fake Operators and Equality
  38. Equivalence
  39. ==
  40. equal? and object_id
  41. ===
  42. eql?
  43. Fake Operators
  44. Comparison Methods
  45. Right and Left Shift
  46. Plus
  47. Element Setters and Getters
  48. Collaborator Objects