Method: Contentful::Management::Space.create
- Defined in:
- lib/contentful/management/space.rb
.create(attributes) ⇒ Object
Create a space. Takes a hash of attributes with optional organization id if client has more than one organization. Returns a Contentful::Management::Space.
52 53 54 55 56 57 58 59 60 61 62 |
# File 'lib/contentful/management/space.rb', line 52 def self.create(attributes) request = Request.new( '', {'name' => attributes.fetch(:name)}, id = nil, organization_id: attributes[:organization_id] ) response = request.post result = ResourceBuilder.new(response, {}, {}) result.run end |