class Pinterest::User
A object representing a Pinterest
user.
Constants
- FIELDS
The list of fields of the object.
Public Class Methods
create(data)
click to toggle source
Creates a new user object.
@param data [Hash] The data of the new object. For a list of valid fields, see `Pinterest::User::FIELDS`. @return [Pinterest::Board] The new user object.
# File lib/pinterest/models/user.rb, line 18 def self.create(data) data["created_at"] = Pinterest::Entity.parse_timestamp(data["created_at"]) if data["created_at"] 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
Pinterest::Entity#as_json
# File lib/pinterest/models/user.rb, line 29 def as_json(options = {}) super(::Pinterest::User::FIELDS, options) end