I got a string
'tileBlock.tag.title'
[
"title"=>"headline",
"body"=>"body text",
"link"=>"#",
"tileBlock"=>{"title"=>"Home", "tag"=>{"title"=>"home", "id"=>45}, "active"=>true}
]
'tileBlock.tag.title'
'object[:tileBlock][:tag][:title]
You can use Enumerable#inject
, take str="tileBlock.tag.title"
.
str.split(".").inject(object) { |m, x| m[x] }