How do you create a new file?
Ruby has a built in class called File. So it follows the same rules as creating an instance of a class. For example:
(instance of a class) class Person end
person = Person.new(“James”)
Example for file:
file = File.new(“filename”, “r”)
r* is example
mode strings: read
r
mode string: write
w
mode string: read and write
r+