The TrelloEntities module has all the classes that represent things like Boards, Lists and Cards in Trello. They are basically a wrapper for the Trello API but done in such as way as to loosely emulate the "plain english" style of Butler for Trello.
The TrelloEntities classes make heavy use of the module:TrellinatorCore.IterableCollection class for returning collections of entities and as such will usually throw module:Exceptions.InvalidDataException when the requested information does not exist.
Methods are designed to be "chainable" as much as possible, and thus favour throwing exceptions over a "null return". This means that you're better off putting a try/catch block around a "fluent" chain of method calls rather than doing lots of "if this then that" type of checking.
- Source:
Example
try
{
//If the list, card or board don't exist
//an InvalidDataException will be thrown
new Trellinator.board("My Board")
.list("There or not?")
.card("Maybe I'm here ... ")
.postComment("@"+new Notification(posted).member().name()+" hi there!");
}
catch(e)
{
Notification.expectException(InvalidDataException,e);
new Notification(posted).card().postComment("Something wasn't there ... ");
}