flosse/scaleApp — pull request #30 by strathausen (2012-09-28 10:32:25+00:00)
Title: constructor changes

Hi again,

Thanks for the quick merge! I have some more small things for the constructor of the state plugin.

1. `addState` already covers many cases (id with opts, array, object) so the constructor doesn't have to do much here but just pass the `states` property on to `addState`.

2. In the state test, `@machine = new @scaleApp.StateMachine` is meant to be for the browser as well, right?

3. It is now be possible to have a `transitions` property as an object in the constructor, but not an array.

4. For the `start` state in the constructor it is now also possible to specify `leave` and `enter` methods.

5. On construction, the `enter` method of the `start` state gets fired - I think it comes in handy when setting something up. What do you think?

I think 3. and 4. also make more sense with the examples on scaleapp.org.

Hope that you like the code!

Cheers,
Philipp