Class: ButterCMS::Content

Inherits:
ButterResource show all
Defined in:
lib/buttercms/content.rb

Instance Attribute Summary

Attributes inherited from ButterResource

#data, #meta

Class Method Summary collapse

Methods inherited from ButterResource

all, create, endpoint, find, #initialize, #inspect, #marshal_dump, #marshal_load, patch_endpoint, update

Constructor Details

This class inherits a constructor from ButterCMS::ButterResource

Class Method Details

.fetch(collection_slugs, options = {}) ⇒ Object



13
14
15
16
17
18
# File 'lib/buttercms/content.rb', line 13

def self.fetch(collection_slugs, options = {})
  params = { keys: collection_slugs.join(',') }.merge(options)
  response = ButterCMS.request(self.resource_path, params)
  
  self.new(response)
end

.list(collection_slug, options = {}) ⇒ Object



7
8
9
10
11
# File 'lib/buttercms/content.rb', line 7

def self.list(collection_slug, options = {})
  response = ButterCMS.request(self.endpoint(collection_slug), options)

  self.create_collection(response)
end

.resource_pathObject



3
4
5
# File 'lib/buttercms/content.rb', line 3

def self.resource_path
  "/content/"
end