Sha256: 3a1444aa13f934fbca5ab917f326627e3083f7921732d63415993fbd459dcbb6
Contents?: true
Size: 1.33 KB
Versions: 18
Compression:
Stored size: 1.33 KB
Contents
require_relative 'resource_requester' module Contentful module Management # Wrapper for Space API for usage from within Client # @private class ClientSpaceMethodsFactory attr_reader :client def initialize(client) @client = client @resource_requester = ResourceRequester.new(client, associated_class) end # Gets a collection of spaces. # # @return [Contentful::Management::Array<Contentful::Management::Space>] def all @resource_requester.all end # Gets a specific space. # # @param [String] space_id # # @return [Contentful::Management::Space] def find(space_id) @resource_requester.find(space_id: space_id) end # 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] def create(attributes) associated_class.create(client, attributes) end def new object = associated_class.new object.client = client object end def associated_class ::Contentful::Management::Space end end end end
Version data entries
18 entries across 18 versions & 1 rubygems