5

I have map like this:

data = {user.name: "John",
        user.surname: "Doe",
        city: "NY"}

I can access attiribute 'city' this way:

data.city

Is there is a similar way to access 'user.name' attribute?

tim_yates
  • 167,322
  • 27
  • 342
  • 338
Vladimir
  • 12,753
  • 19
  • 62
  • 77

1 Answers1

14

Assuming you meant:

data = [ 'user.name':"John", 'user.surname':"Doe", city:"NY" ]

(square braces for the map definition, and quotes round the dotted key names), I believe that

data.'user.name'

should do it

tim_yates
  • 167,322
  • 27
  • 342
  • 338