Sha256: 54ab2ea0d6b36fcdca0d2d2093b84472b61f2600886678707fdf9be670a0e6bf

Contents?: true

Size: 539 Bytes

Versions: 6

Compression:

Stored size: 539 Bytes

Contents

require 'fog/core/collection'
require 'fog/aws/models/sns/topic'

module Fog
  module AWS
    class SNS
      class Topics < Fog::Collection
        model Fog::AWS::SNS::Topic

        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

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

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
fog-aws-0.1.1 lib/fog/aws/models/sns/topics.rb
fog-aws-0.1.0 lib/fog/aws/models/sns/topics.rb
fog-aws-0.0.8 lib/fog/aws/models/sns/topics.rb
fog-aws-0.0.7 lib/fog/aws/models/sns/topics.rb
fog-aws-0.0.6 lib/fog/aws/models/sns/topics.rb
fog-aws-0.0.5 lib/fog/aws/models/sns/topics.rb