ruby hash convert value if nil code example
Example 1: ruby assign value to hash
grades = Hash.new
grades["Dorothy Doe"] = 9
Example 2: how ruby methods take in a hash of attributes
def create(name:, age:, gender:) #Main lesson on this line
some_variable = SomeClass.new(name, age, gender)
some_variable.save #save is an instance method undefined here
some_variable
end