Class: Pinterest::Interest

Inherits:
Entity
  • Object
show all
Defined in:
lib/pinterest/models/interest.rb

Overview

A object representing a Pinterest interest (topic).

Constant Summary

FIELDS =

The list of fields of the object.

["id", "name"].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Entity

#initialize, parse_timestamp

Constructor Details

This class inherits a constructor from Pinterest::Entity

Class Method Details

.create(data) ⇒ Pinterest::Board

Creates a new interest (topic) object.

Parameters:

  • data (Hash)

    The data of the new object. For a list of valid fields, see Pinterest::Interest::FIELDS.

Returns:



18
19
20
# File 'lib/pinterest/models/interest.rb', line 18

def self.create(data)
  new(data)
end

Instance Method Details

#as_json(options = {}) ⇒ Hash

Serialize the object as a Hash that can be serialized as JSON.

Parameters:

  • options (Hash) (defaults to: {})

    The options to use to serialize.

Returns:

  • (Hash)

    The serialized object.



26
27
28
# File 'lib/pinterest/models/interest.rb', line 26

def as_json(options = {})
  super(::Pinterest::Interest::FIELDS, options)
end