Class: Fog::AWS::SNS::Topics

Inherits:
Collection
  • Object
show all
Defined in:
lib/fog/aws/models/sns/topics.rb

Instance Method Summary collapse

Instance Method Details

#allObject



9
10
11
12
13
# File 'lib/fog/aws/models/sns/topics.rb', line 9

def all
  data = service.list_topics.body["Topics"].map { |t| {"id" => t} } #This is an array, but it needs to be an array of hashes for #load

  load(data)
end

#get(id) ⇒ Object



15
16
17
18
19
# File 'lib/fog/aws/models/sns/topics.rb', line 15

def get(id)
  if data = service.get_topic_attributes(id).body["Attributes"]
    new(data)
  end
end