Sha256: a5db713fc6564f5728f1ec29082c293704fbce588c68c5f43350e1b23a8f11a7

Contents?: true

Size: 682 Bytes

Versions: 9

Compression:

Stored size: 682 Bytes

Contents

module Zype
  # Read more at https://docs.zype.com/v1.0/reference#users.
  # This class does not support the delete method.
  #
  # @since 0.13.0
  class Users < Zype::BaseModel
    %i[delete].each do |mtd|
      send(:define_method, mtd) do
        raise NoMethodError
      end
    end

    # Remove a user from a site property. This does not delete the user.
    # Read more at https://docs.zype.com/v1.0/reference#removeuser
    #
    # @param id [String] the ID of the user
    # @return [Hash] the user object
    def remove(id:)
      client.execute(method: :put, path: "/#{path}/#{id}/remove")
    end

    private

    def path
      @path = 'site/users'
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
zype-0.20.0 lib/zype/models/users.rb
zype-0.19.0 lib/zype/models/users.rb
zype-0.18.0 lib/zype/models/users.rb
zype-0.17.0 lib/zype/models/users.rb
zype-0.16.1 lib/zype/models/users.rb
zype-0.16.0 lib/zype/models/users.rb
zype-0.15.0 lib/zype/models/users.rb
zype-0.14.0 lib/zype/models/users.rb
zype-0.13.0 lib/zype/models/users.rb