class Hubspot::Topic
HubSpot
Topics API
Constants
- TOPICS_PATH
- TOPIC_PATH
Attributes
properties[R]
Public Class Methods
find_by_topic_id(id)
click to toggle source
Finds the details for a specific topic_id {developers.hubspot.com/docs/methods/blogv2/get_topics_topic_id } @return Hubspot::Topic
# File lib/hubspot/topic.rb, line 21 def find_by_topic_id(id) response = Hubspot::Connection.get_json(TOPIC_PATH, { topic_id: id }) new(response) end
list()
click to toggle source
Lists the topics {developers.hubspot.com/docs/methods/blogv2/get_topics) @return [Hubspot::Topic] array of topics
# File lib/hubspot/topic.rb, line 13 def list response = Hubspot::Connection.get_json(TOPICS_PATH, {}) response['objects'].map { |t| new(t) } end
new(response_hash)
click to toggle source
# File lib/hubspot/topic.rb, line 29 def initialize(response_hash) @properties = response_hash #no need to parse anything, we have properties end
Public Instance Methods
[](property)
click to toggle source
# File lib/hubspot/topic.rb, line 33 def [](property) @properties[property] end