I came across some Ruby code, I'm trying to understand why the variables have a colon at the end of their name inside the method declaration initialize.
Is there a reason for colon?
attr_reader :var1, :var2
def initialize(var1:, var2:)
@var1 = var1
@var2 = var2
end
source
share