ruby - Can I omit braces for a hash in a hash? -
i have hash in hash:
validates :password, length: { within: 5..30 }, presence: true
is possible omit braces hash in hash? this:
validates :password, length: within: 5..30, presence: true
raises syntax error.
more accurately, have hash literal within hash literal happens lastly argument in method call. time can leave out braces when hash lastly argument in method call, required everywhere else. inner hash value in hash literal , that's not lastly argument in method phone call so, no, can't that.
ruby hash
No comments:
Post a Comment