Access fields of Named Tuple
tpl = {fname: "Foo", "lname": "Bar"}
puts tpl
puts typeof(tpl)
puts tpl[:fname]
puts tpl["fname"]
puts tpl[:lname]
puts tpl["lname"]
# tpl["fname"] = "Jane"
# tpl["lname"] = "Bar"
Press ← or → to navigate between chapters
Press S or / to search in the book
Press ? to show this help
Press Esc to hide this help
tpl = {fname: "Foo", "lname": "Bar"}
puts tpl
puts typeof(tpl)
puts tpl[:fname]
puts tpl["fname"]
puts tpl[:lname]
puts tpl["lname"]
# tpl["fname"] = "Jane"
# tpl["lname"] = "Bar"