class Contentful::Management::ClientSpaceMethodsFactory

Wrapper for Space API for usage from within Client @private

Attributes

client[R]

Public Class Methods

new(client) click to toggle source
# File lib/contentful/management/client_space_methods_factory.rb, line 10
def initialize(client)
  @client = client
  @resource_requester = ResourceRequester.new(client, associated_class)
end

Public Instance Methods

all(query = {}) click to toggle source

Gets a collection of spaces.

@return [Contentful::Management::Array<Contentful::Management::Space>]

# File lib/contentful/management/client_space_methods_factory.rb, line 18
def all(query = {})
  @resource_requester.all({}, query)
end
associated_class() click to toggle source
# File lib/contentful/management/client_space_methods_factory.rb, line 49
def associated_class
  ::Contentful::Management::Space
end
create(attributes) click to toggle source

Create a space.

@param [Hash] attributes @option attributes [String] :name @option attributes [String] :default_locale @option attributes [String] :organization_id Required if user has more than one organization

@return [Contentful::Management::Space]

# File lib/contentful/management/client_space_methods_factory.rb, line 39
def create(attributes)
  associated_class.create(client, attributes)
end
find(space_id) click to toggle source

Gets a specific space.

@param [String] space_id

@return [Contentful::Management::Space]

# File lib/contentful/management/client_space_methods_factory.rb, line 27
def find(space_id)
  @resource_requester.find(space_id: space_id)
end
new() click to toggle source
# File lib/contentful/management/client_space_methods_factory.rb, line 43
def new
  object = associated_class.new
  object.client = client
  object
end