Sha256: 91184f218f30b8cc1e2815b910e0d0611c525e7b26419837cff5c0712b3143af

Contents?: true

Size: 965 Bytes

Versions: 2

Compression:

Stored size: 965 Bytes

Contents

#
# This file is part of the pinterest-ruby gem. Copyright (C) 2017 and above Shogun <shogun@cowtech.it>.
# Licensed under the MIT license, which can be found at https://choosealicense.com/licenses/mit.
#

module Pinterest
  # A object representing a Pinterest interest (topic).
  class Interest < Entity
    # The list of fields of the object.
    FIELDS = ["id", "name"].freeze

    attr_accessor(*FIELDS)

    # Creates a new interest (topic) object.
    #
    # @param data [Hash] The data of the new object. For a list of valid fields, see `Pinterest::Interest::FIELDS`.
    # @return [Pinterest::Board] The new interest object.
    def self.create(data)
      new(data)
    end

    # 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.
    def as_json(options = {})
      super(::Pinterest::Interest::FIELDS, options)
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pinterest-ruby-1.0.2 lib/pinterest/models/interest.rb
pinterest-ruby-1.0.1 lib/pinterest/models/interest.rb