class Contentful::Management::ContentTypeEntryMethodsFactory
Wrapper for Entry
manipulation for a specific Content Type @private
Attributes
Public Class Methods
Source
# File lib/contentful/management/content_type_entry_methods_factory.rb, line 13 def initialize(content_type) @content_type = content_type end
@private
Public Instance Methods
Source
# File lib/contentful/management/content_type_entry_methods_factory.rb, line 27 def all(params = {}) Entry.all(content_type.client, content_type.space.id, content_type.environment_id, params.merge(content_type: content_type.id)) end
Gets all entries for a specific ContentType
@param [Hash] params @see _ For complete option list: www.contentful.com/developers/docs/references/content-delivery-api/#/reference/search-parameters @option params [String] ‘sys.id’ @option params [String] :limit @option params [String] :skip @option params [String] :order
@return [Contentful::Management::Array<Contentful::Management::Entry>]
Source
# File lib/contentful/management/content_type_entry_methods_factory.rb, line 36 def create(attributes) attributes[:content_type] = content_type Entry.create(content_type.client, content_type.space.id, content_type.environment_id, attributes) end
Creates an entry for a content type.
@param [Hash] attributes
@return [Contentful::Management::Entry]
Source
# File lib/contentful/management/content_type_entry_methods_factory.rb, line 44 def new dynamic_entry_class = content_type.client.register_dynamic_entry( content_type.id, DynamicEntry.create(content_type, content_type.client) ) dynamic_entry = dynamic_entry_class.new dynamic_entry.space = content_type.space dynamic_entry.content_type = content_type dynamic_entry end
Instantiates an empty entry for a content type.
@return [Contentful::Management::Entry]