Class: Unsplash::Category

Inherits:
Client
  • Object
show all
Defined in:
lib/unsplash/category.rb

Overview

Unsplash Category operations.

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Client

#connection, connection, connection=, #initialize, #reload!, #to_h

Constructor Details

This class inherits a constructor from Unsplash::Client

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Unsplash::Client

Class Method Details

.allArray

Get a list of all of the Unsplash photo categories. DEPRECATED

Returns:

  • (Array)

    The list categories.



11
12
13
# File 'lib/unsplash/category.rb', line 11

def all
  raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end

.find(id) ⇒ Unsplash::Category

Get an Unsplash Category. DEPRECATED

Parameters:

  • id (Integer)

    The ID of the category to retrieve.

Returns:



19
20
21
# File 'lib/unsplash/category.rb', line 19

def find(id)
  raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end

Instance Method Details

#photos(page = 1, per_page = 10) ⇒ Array

Get a list of all photos in this category. DEPRECATED

Parameters:

  • page (Integer) (defaults to: 1)

    Which page of search results to return.

  • per_page (Integer) (defaults to: 10)

    The number of search results per page.

Returns:

  • (Array)

    A single page of Unsplash::Photos.



29
30
31
# File 'lib/unsplash/category.rb', line 29

def photos(page = 1, per_page = 10)
  raise Unsplash::DeprecationError.new "Category has been deprecated and removed."
end