Class: Pinterest::Board
Overview
A object representing a Pinterest board.
Constant Summary collapse
- FIELDS =
The list of fields of the object.
["id", "name", "url", "description", "creator", "created_at", "counts", "image"].freeze
Class Method Summary collapse
-
.create(data) ⇒ Pinterest::Board
Creates a new board object.
Instance Method Summary collapse
-
#as_json(options = {}) ⇒ Hash
Serialize the object as a Hash that can be serialized as JSON.
Methods inherited from Entity
Constructor Details
This class inherits a constructor from Pinterest::Entity
Class Method Details
.create(data) ⇒ Pinterest::Board
Creates a new board object.
18 19 20 21 22 23 24 |
# File 'lib/pinterest/models/board.rb', line 18 def self.create(data) data["created_at"] = Pinterest::Entity.(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 |