RUBY is?; an open source language that focuses on ease of use and is made…
RUBY is?; an open source language that focuses on ease of use and is made of objects and variables
(are provided by the class. the string class has certain methods, same for array, and etc)
responds to user events, and makes changes to model+view based on that.
objects/data in database
rails is built on this fundamental architecture
Objects (aka instances) are?; data structures that consist of data + methods that are bound together. Data = things like strings and numbers. Methods = a set of expressions that returns a value. Methods are bound to objects and can be inside a class or outside of a class.
Class is a?; predefined object that contains data (classes like fixnum and string) and methods (string.new). Anything you can do to an object you can do to Class as well classes within Class.
classes are?; objects that consist of characteristics (data) and functions (methods). they are called instances of Class. They should really be called subclasses, but for some god forsaken reason the creator(s) of ruby decided to just name them class.
Objects in a class (subclass) are?; instances of the class (subclass). They contain data + methods. An analogy to the real world would by the abstract concept of bicycles (a class) which contains all the physical bicycles that people own/buy (these would be objects)
Getter is an?; object method inside a class.
writes but won't read from a class
is how you change a value from a class when outside it
def variable= lets ruby know this is a setter method
reads but won't write to a class
is how you retrieve a value from a class when outside it
Getter + setter
Setter is an?; object method inside a class.
Getter + Setter is an?; object method inside a class.
variables are?; not technically an object, but rather like a label representing an object. Aka "pointers"
(disappears after method call is over)
class variable (prefix /w @ @ )
the @ symbol becomes part of the variable name from now on when you want to reference it
tied to the class, not the instance/object
instance variable (prefix with @ )
keeps value between method calls, but only inside the class
examples of classes: