class Pinterest::Board

A object representing a Pinterest board.

Constants

FIELDS

The list of fields of the object.

Public Class Methods

create(data) click to toggle source

Creates a new board object.

@param data [Hash] The data of the new object. For a list of valid fields, see `Pinterest::Board::FIELDS`. @return [Pinterest::Board] The new board object.

# File lib/pinterest/models/board.rb, line 18
def self.create(data)
  data["created_at"] = Pinterest::Entity.parse_timestamp(data["created_at"]) if data["created_at"]
  data["creator"] = Pinterest::User.create(data["creator"]) if data["creator"]
  data["image"] = Pinterest::Image.new(data["image"]) if data["image"]

  new(data)
end

Public Instance Methods

as_json(options = {}) click to toggle source

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

@param options [Hash] The options to use to serialize. @return [Hash] The serialized object.

Calls superclass method
# File lib/pinterest/models/board.rb, line 30
def as_json(options = {})
  super(::Pinterest::Board::FIELDS, options)
end