class Fog::Google::Pubsub::Topics
Public Instance Methods
all()
click to toggle source
Lists all topics that exist on the project.
@return [Array<Fog::Google::Pubsub::Topic>] list of topics
# File lib/fog/google/models/pubsub/topics.rb, line 13 def all data = service.list_topics.to_h[:topics] || [] load(data) end
get(topic_name)
click to toggle source
Retrieves a topic by name
@param topic_name [String] name of topic to retrieve @return [Fog::Google::Pubsub::Topic] topic found, or nil if not found
# File lib/fog/google/models/pubsub/topics.rb, line 22 def get(topic_name) topic = service.get_topic(topic_name).to_h new(topic) rescue ::Google::Apis::ClientError => e raise e unless e.status_code == 404 nil end