module Contentful::Management::SpaceAssociationMethodsFactory
Wrapper for Space
Association Methods @private
Attributes
Public Class Methods
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 12 def initialize(space) @space = space end
Public Instance Methods
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 16 def all(params = {}) associated_class.all(space.client, space.id, nil, params) end
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 35 def associated_class class_name = /\A(.+)Space(.+)MethodsFactory\z/.match(self.class.name).captures.join class_name.split('::').reduce(Object) do |mod, actual_class_name| mod.const_get(actual_class_name) end end
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 24 def create(attributes) associated_class.create(space.client, space.id, attributes) end
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 20 def find(id) associated_class.find(space.client, space.id, id) end
Source
# File lib/contentful/management/space_association_methods_factory.rb, line 28 def new object = associated_class.new object.sys[:space] = space object.client = space.client object end