Hi I retrieved an Array from GMAIL API.
I want to record just the name of the receiver. I am pulling all sent emails into my app.
Here's the array that I retrieved:
[#<struct Net::IMAP::Address name="Shiela S", route=nil, mailbox="Shielas", host="test.com">]
I want to pass the receiver name into my Activity
table . I already have the correct logic in passing values to my ActiveRecord but then how can I get just the name from the array above (dynamically).
I've tried to strip or split other unnecessary strings inside the array but no luck..
I want to end up having just the name which is Shiela S
from the array above.
Any suggestions? Thanks
UPDATE
I've tried to convert to string and it worked!
In string:
"[#<struct Net::IMAP::Address name=\"Shiela S\", route=nil, mailbox=\"Shielas\", host=\"test.com\">]"
Is there a better way than using slice!
method to get the Shiela S
substring?
Thanks