// State machine representing URI's
//
// Cleans up the logic of connecting via ports,
// urls or file sockets.

var state = require('state');


module.exports = state({
  // Possible states for the URI
  Initial: state('initial'),
  Url: state(),
  Port: state(),
  File: state(),
});

// State machine representing URI's
//
// Cleans up the logic of connecting via ports,
// urls or file sockets.

var state = require('state');

module.exports = state({
  // Possible states for the URI
  Initial: state('initial', {
    set: function(value) {
      this.input = value;
    }
  }),
  Url: state(),
  Port: state(),
  File: state(),

  // default for all
  get: function() {
    return this.input;
  }
});

Add implimentations of the .get and .set methods.
Add implimentations of the .get and .set methods.

When you have a property that is only a function, it
will be the method implementation used when the
object is in that state, or any of it's child
substates.

In this case, a call to uri.get() will reach the
same function, no matter the state.

With an object in the 'Initial' state, a call
to uri.set(3000) will reach the method defined
in that state.
