Sha256: f3a2881a5d1c331cb987236a7755600cb55aa2d1df5974de1f5a641262a79a90

Contents?: true

Size: 767 Bytes

Versions: 1

Compression:

Stored size: 767 Bytes

Contents

module Sdbport
  class Domain
    class Purge

      def initialize(args)
        @name       = args[:name]
        @logger     = args[:logger]
        @access_key = args[:access_key]
        @secret_key = args[:secret_key]
        @region     = args[:region]
      end

      def purge
        @logger.info "Purging #{@name} in #{@region}."
        data = sdb.select "select * from `#{@name}`"
        data.keys.each do |key|
          @logger.debug "Deleting #{key}."
          sdb.delete @name, key
        end
      end

      private

      def sdb
        @sdb ||= AWS::SimpleDB.new :access_key => @access_key,
                                   :secret_key => @secret_key,
                                   :region     => @region
      end

    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
sdbport-0.1.0 lib/sdbport/domain/purge.rb