Retrieving Twitter account from Mac OS X Lion's Address Book via MacRuby

Software Engineering 178 views

The code assumes Mac OS X 10.7. Also, the code could be represented differently (i.e. without using a Range) if ABMutableMultiValue behaved like a Ruby Array or supported .to_a

me =
account = ( {|i| break me.socialProfile.valueAtIndex(i)['username'] if me.socialProfile.valueAtIndex(i)['serviceName'] == 'Twitter' } || me.nickname