Sha256: 8d46f70ab223f805c84b3ba04f08826d8fc1da00334c139bf51def84565d951b

Contents?: true

Size: 761 Bytes

Versions: 53

Compression:

Stored size: 761 Bytes

Contents

class Ey::Core::Client
  class Real
    def update_membership(params={})
      id = params.delete("id")
      request(
        :method => :put,
        :path   => "/memberships/#{id}",
        :body   => params,
      )
    end
  end

  class Mock
    def update_membership(params={})
      resource_id = resource_identity(params)

      membership = self.find(:memberships, resource_id)
      if params["membership"] && params["membership"]["accepted"]
        self.find(:accounts, resource_identity(membership["account"]))[:account_users] << resource_identity(membership["user"])
      end

      #NOTE: doesn't currently support updating role
      response(
        :body   => {"membership" => membership},
        :status => 200,
      )
    end
  end
end

Version data entries

53 entries across 53 versions & 3 rubygems

Version Path
ey-core-3.6.4 lib/ey-core/requests/update_membership.rb
ey-core-3.6.3 lib/ey-core/requests/update_membership.rb
ey-core-3.6.1 lib/ey-core/requests/update_membership.rb
groove-ey-core-3.6.3 lib/ey-core/requests/update_membership.rb
groove-ey-core-3.6.2 lib/ey-core/requests/update_membership.rb
groove-ey-core-3.6.1 lib/ey-core/requests/update_membership.rb
ey-core-3.5.0 lib/ey-core/requests/update_membership.rb
ey-core-3.4.4 lib/ey-core/requests/update_membership.rb
ey-core-3.4.2 lib/ey-core/requests/update_membership.rb
ey-core-3.4.1 lib/ey-core/requests/update_membership.rb
ey-core-3.4.0 lib/ey-core/requests/update_membership.rb
ey-core-3.3.1 lib/ey-core/requests/update_membership.rb
ey-core-3.3.0 lib/ey-core/requests/update_membership.rb
ey-core-3.2.6 lib/ey-core/requests/update_membership.rb
ey-core-3.2.5 lib/ey-core/requests/update_membership.rb
ey-core-3.2.4 lib/ey-core/requests/update_membership.rb
ey-core-3.2.3 lib/ey-core/requests/update_membership.rb
ey-core-3.2.2 lib/ey-core/requests/update_membership.rb
ey-core-3.2.1 lib/ey-core/requests/update_membership.rb
ey-core-3.2.0 lib/ey-core/requests/update_membership.rb