Sha256: e4d8f6787e1e13f5c2fe5abce9906bf2439658e4b985156243ffa8a5b9cd19c9

Contents?: true

Size: 826 Bytes

Versions: 3

Compression:

Stored size: 826 Bytes

Contents

class Ey::Core::Client
  class Real
    def update_connector(params={})
      request(
        :method => :put,
        :path   => "/connectors/#{params["id"]}",
        :body   => params,
      )
    end
  end # Real

  class Mock
    def update_connector(params={})
      identity = resource_identity(params)
      connector  = find(:connectors, identity)

      update_params = Cistern::Hash.slice(params["connector"], "configuration")

      # core api doesn't actually do this yet
      if config = update_params.delete("configuration")
        update_params["configuration"] = normalize_hash(config)
      end

      connector.merge!(update_params)

      response(
        :body => { "connector" => connector },
        :status => 200
      )
    end
  end # Mock
end # Ey::Core::Client

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ey-core-3.6.6 lib/ey-core/requests/update_connector.rb
ey-core-3.4.5 lib/ey-core/requests/update_connector.rb
ey-core-3.6.5 lib/ey-core/requests/update_connector.rb