Class: ButterCMS::Category

Inherits:
Resource show all
Defined in:
lib/butter_cms/category.rb

Class Method Summary collapse

Methods inherited from Resource

#initialize

Constructor Details

This class inherits a constructor from ButterCMS::Resource

Class Method Details

.allArray<ButterCMS::Category>

Returns all categories

Returns:



7
8
9
10
11
12
# File 'lib/butter_cms/category.rb', line 7

def self.all
  response = ::ButterCMS::Requests::Get.call("categories")
  attributes = ::ButterCMS::Parsers::Categories.new(response).categories

  ::ButterCMS::Parsers::CategoriesObjects.call(attributes)
end