Sha256: 7352598bd4f30aeba9ac41df57f71b2ede5be09a8d20df5b38e50b709d16c62f

Contents?: true

Size: 1.09 KB

Versions: 6

Compression:

Stored size: 1.09 KB

Contents

module Ribose
  class Member < Ribose::Base
    include Ribose::Actions::All
    include Ribose::Actions::Delete

    # List A Space Members
    #
    # This interface retrieves the list of members for any speicfic
    # user spaces and then will return those as `Sawyer::Resource`
    #
    # @param space_id [String] The Space Id
    # @param options [Hash] Query parameters as a Hash
    # @return [Array<Sawyer::Resource>]
    #
    def self.all(space_id, options = {})
      new(space_id: space_id, **options).all
    end

    # Delete a space member
    #
    # @param space_id [String] The Space UUID
    # @param member_id [String] The Member UUID
    # @param options [Hash] Query parameters as Hash
    #
    def self.delete(space_id, member_id, options = {})
      new(space_id: space_id, resource_id: member_id, **options).delete
    end

    private

    attr_reader :space_id

    def resource
      "spaces_user"
    end

    def resources_path
      ["spaces", space_id, "members"].join("/")
    end

    def extract_local_attributes
      @space_id = attributes.delete(:space_id)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ribose-0.5.0 lib/ribose/member.rb
ribose-0.4.1 lib/ribose/member.rb
ribose-0.4.0 lib/ribose/member.rb
ribose-0.3.2 lib/ribose/member.rb
ribose-0.3.1 lib/ribose/member.rb
ribose-0.3.0 lib/ribose/member.rb