alphagov/vcloud-edge_gateway — pull request #67 by mattbostock (2014-05-19 14:03:35+00:00)
Title: [Fixes #71223820] Refactor update_required?

Refactor `Vcloud::EdgeGateway::EdgeGatewayConfiguration.update_required?` so that it does not modify `Vcloud::EdgeGateway::EdgeGatewayConfiguration.config`, which is potentially confusiong for a method that by convention should only return a boolean.

The logic in `update_required?` has moved to the `config()` method, which has been renamed to `generate_new_config()` to make the name more descriptive.

I have also removed `local_config`, `remote_config`, and `edge_gateway_interfaces` as instance variables; these are now passed to `generate_new_config()`.

`generate_new_config()` is now a private method so that we can change our internal interfaces more easily without worrying about making what would have been breaking changes; it's also called immediately from
the `initialize()` method.

`generate_new_config()` does not update the `@config` instance variable, rather it updates a `new_config` method variable which it then returns. I've added an `attr_reader` for the `@config` instance variable
accordingly.