class Contentful::Management::ClientSpaceMethodsFactory
Attributes
client[R]
Public Class Methods
new(client)
click to toggle source
# File lib/contentful/management/client_space_methods_factory.rb, line 12 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 20 def all(query = {}) @resource_requester.all({}, query) end
associated_class()
click to toggle source
# File lib/contentful/management/client_space_methods_factory.rb, line 51 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 41 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 29 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 45 def new object = associated_class.new object.client = client object end