Sha256: 38fe15006f7394a6300d187ee017bbde2f492ba97c8bee3cafa1cba50232e801

Contents?: true

Size: 719 Bytes

Versions: 4

Compression:

Stored size: 719 Bytes

Contents

module Vcloud
  module EdgeGateway
    class LoadBalancerConfigurationDiffer

        def initialize local, remote
          @local = local
          @remote = remote
        end

        def diff
          ( @local == stripped_remote_config ) ? [] : HashDiff.diff(@local, stripped_remote_config)
        end

        def stripped_remote_config
          return nil if @remote.nil?
          deep_cloned_remote_config = Marshal.load( Marshal.dump(@remote) )
          if deep_cloned_remote_config.key?(:Pool)
            deep_cloned_remote_config[:Pool].each do |pool_entry|
              pool_entry.delete(:Operational)
            end
          end
          deep_cloned_remote_config
        end

    end
  end

end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
vcloud-edge_gateway-0.2.2 lib/vcloud/edge_gateway/load_balancer_configuration_differ.rb
vcloud-edge_gateway-0.2.1 lib/vcloud/edge_gateway/load_balancer_configuration_differ.rb
vcloud-edge_gateway-0.2.0 lib/vcloud/edge_gateway/load_balancer_configuration_differ.rb
vcloud-edge_gateway-0.1.0 lib/vcloud/edge_gateway/load_balancer_configuration_differ.rb