ruby - Can I omit braces for a hash in a hash? -
I have a hash in hash:
valid: password, length: { Inside: 5..30}, Attendance: True
Is it possible for a hash to leave the braces? It:
valid: password, length: inside: 5..30, presence: true
raises a syntax error.
More accurately, you have a hash within the word hash verbatim which is the last log in method call it happens. The only time you can leave the braces, when hash is the last argument in a method call, they require second place everywhere. Your internal hash is a value in the other hash and this is not the last argument in a method call, no, you can not do this
Comments
Post a Comment