@cbuckley is correct in his description, but I want to expand on it and give an example.
vline.Promise.<vline.Collection> getMessages([Number opt_limit])
This indicates that it is returning a vline.Promise
with the result to the success callback being of type vline.Collection
.
Here's an example:
vlinesession.getPerson(userId).done(function(person) {
person.getMessages().done(function(msgCollection) { // msgCollection is a vline.Collection of vline.Message's
for (var i = 0; i < msgCollection.getSize(); i++) {
var msg = msgCollection.getAt(i); // this is the vline.Message
console.log('Message from: ' + msg.getSender() +
' with body: ' + msg.getBody());
}
});
});
Note that I left out the fail
handlers for brevity, but you should include those as well to make your code robust.