module Contentful::Management::SpaceAssociationMethodsFactory
Wrapper for Space
Association Methods @private
Attributes
space[R]
Public Class Methods
new(space)
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 10 def initialize(space) @space = space end
Public Instance Methods
all(params = {})
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 14 def all(params = {}) associated_class.all(space.client, space.id, nil, params) end
associated_class()
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 33 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
create(attributes)
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 22 def create(attributes) associated_class.create(space.client, space.id, attributes) end
find(id)
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 18 def find(id) associated_class.find(space.client, space.id, id) end
new()
click to toggle source
# File lib/contentful/management/space_association_methods_factory.rb, line 26 def new object = associated_class.new object.sys[:space] = space object.client = space.client object end